Mapping between Pixel Bender (in Flash) and Pixel Shaders (in Silverlight)

Can someone explain the differences between Pixel Bender in Flash and Pixel Shader (HLSL) in Silverlight in terms of programming flexibility and runtime performance?

+6
flash silverlight hlsl pixel-bender
source share
2 answers

I don't know about programmability, but as regards performance at runtime, the pixel blender is wonderful. Silverlight 3 currently does not allow you to do this processing in the background, but with PixelBender you can. This is good because the user interface does not greatly affect the use of filters with heavy computing.

There are good pros in this forum for Silverlight 3: Pros and Cons . I know this topic is old, but I am adding it as it seemed a little incomplete.

+1
source share

I really don't know about Silverlight shaders, but I can talk about PixelBender.

The pixelbender shader accepts bitmap data, and each 32-bit pixel (in fact, each piece of 4 floats) evaluates one at a time and performs calculations on it. The input to the shader is one or more images and optional parameters, and the output is always a single image. The calculation takes place in parallel across all the pixels of the image and is “stagnant” between the pixels, which means that you cannot store values ​​when evaluating one pixel and use them in another. In fact, from the point of view of pixel estimation, the function is designed to work with an infinitely large image and therefore is not aware of the size and shape of the image.

The functionality available for Flash Player for shaders is a subset of the entire pixel language. It excludes language features such as library reuse functions and regional functions.

The pixel bend shader can run on a GPU in a separate thread from Flash Player, which basically allows streaming processes in Flash. In practice, this is only useful for flagging large batches, given the lack of statelessness and limited pixel functionality. The sequence number can be transferred to a shader disguised as bitmapdata and executed asynchronously (or synchronously) using ShaderJob.

The syntax of both HLSL and PBJ is C-like and is based on GLSL. I assume that HLSL probably has better performance and more features Microsoft provides with graphics hardware. However, the differences between Flash and Silverlight go far beyond their shaders, and I think Flash outperforms Silverlight in almost every area, so it comes down to making the platform better fit the needs.

0
source share

All Articles