Pixel Bender Differences

I’ve been using Pixel Bender for some projects of mine (SquishFilter, Voxel Renderer). It’s been quite fun to write the pixel bender scripts, but the flash implementation is crippled (no functions, no loop constructs) and behaves diffrent than the gpu and cpu implementations on windows atleast. I’ve found two things:

First: normalize( float2 ) is not giving the same results in flash as gpu/cpu versions. In the flash version I had to replace the function with float2 / length(float2)

Secondly:
I wanted to set the alpha of a pixel4. when the color was pure green (0.,1.,0.) alpha could be set to anything. but when I sat the color to (0.2, 1.0, 0.2) and the alpha to something low as 0.3, the color got gray. What’s up with that?

Also, check this out:
Some Flash Pixel Bender performance tips + benchmarks

Tags: ,