Hi all. I just got started with Pixel Bender. I'm quite experienced writing HLSL shaders so it hasn't been hard for me to get used to the language.
However, after having written a Kernel specifically for Flash, making sure to compile it with Flash compatibility check, it looks completely different when rendered with Flash! On top of that values seem to behave the other way, requiring me to invert them, etc...
Here's an image illustrating the issue:
I'm doing quite some heavy stuff on a perlin noise image, but it works fine on CPU, looks perfect, yet Flash renders a horrible ugly mess..
I really don't know what's going on here, it seems like the out coordinates behave differently or the input image is of a different resolution ?
I hope an Adobe employee can shed some light here. As great as the concept of Pixel Bender is, it's a bit rough around the edges to say the least..
what does the input look like? In CPU mode in the toolkit, you are doing all your processing natively at 32bpp, Flash stores images at 8bpp, so the data is converted in and out of pixel bender processing. There are more details in the Flash section of the documentation included with the Pixel Bender Toolkit.
This is my input, a simple Render Clouds from Photoshop, scaled from 512 to 128:
It really is just a JPG...
What confuses me most, is how the out coordinates work differently. With CPU, I can only work within the confines of the image, with Flash, It scales and i have control over the size of the bitmap ?
I can send you the PBk if you want, prefer not to share my source here.
I think I understand what the problem is, it's with the flash renderer of the toolkit.
My kernel relies heavily on knowing the dimensions of the source image (compared to HLSL this is a very annoying thing, as coordinates always range between 0-1).
Now it seems like the Flash renderer takes the source image and rescales it to fit your screen, making all my wrapping and offsetting code useless, since I can never accurately know the size of the bitmap. Good thing is in my own flash application I have the control I want, but I really suggest changing this in the Toolkit!