1 person found this helpful
you can put the points into a byte array, pass them into Pixel Bender as an image and pass them out as pixel values. Not too hard.
A Pixel4 is the same thing as a Float4, so if you are doing x, y points, you can put them into a buffer as (x1,y1,x2,y2) and then do a kernel that uses pixel.rg and pixel.ba as two different points.
Well the number of pixels (400 x 400 = 160000) greatly exceeds the number of points being put in (8000). It would be good if there was an equivalent to the setPixel function we have in actionscript but I'm not aware of one in pixelbender. I'm thinking perhaps just calculate the positions in pixelbender and hope the performance increases it has over flash will be enough.
Can someone show me a working example of how to set up a ShaderJob in AS3 that would accept 4 values from a Vector.<Number> at once and output those into another Vector.<Number> (including the simplest pixelbender bytecode this is possible with)? Every time I've tried to use ShaderJob I've been unsuccessful and have had to try something else.
Thanks a lot,
Alright so I got it working sortof... The problem now is that it only gives me 8 useable results, and the others are either 0, numbers very close to 0 (eg: 1.454326456e-41) or very large numbers (6.52342342e28) which are absolutely not what I'm looking for. I applied the exact same calculation in flash before, and had no problem. Even outputting outCoord() gives me very strange results past 8 correct values. Has anyone had any similar problems and does anyone know how to fix it? I saw two similar complaints on bugs.adobe.com, but they were unresolved.
Thanks in advance for any help,