-
Señor Member
[RESOLVED] Pixel Bender in flash - Flash approved, but doesn't work anyways.
I've been experimenting with Pixel Bender since I got it and have slowly made my way to creating somewhat simple filters. I've also been using them with flash for quite a while. And I seem to have found a bug or something. Inside the evaluatePixel function, try putting just the following:
dst = sampleNearest(src, outCoord());
dst.b = (outCoord().y / 40.0) - floor(outCoord().y / 40.0); //used to have mod here, thought it was the problem... it wasnt
dst.g = floor(0.8);
dst.r = (dst.r * 4.0) - float(int(dst.r * 4.0));
Run the filter on an image. Now load the same image into flash, load in the filter with URLLoader and make it a shaderFilter. Then apply it to your image. You get something different. In the actual filter that I was trying to debug I got a completely different result using the exact same code as up there.. (that one had vertical green lines running the entire height of the image, spaced out once every 4 pixels. Same code, but those lines don't appear in this filter.) What's the problem here?
Mavrisa
Haikus are easy
But sometimes they don't make sense
Refrigerator
-
Señor Member
Okay. I found a bug in pixelbender which is causing the problem. I don't really know where to report it though, so I'll start with here and then go search around on adobe.
The step(x,y) function is what causes the problem.
If y <= x, returns 0.0, otherwise returns 1.0.
However, once exported to a pbj, it seems to perform the opposite, which is what caused my initial error. I dont know what the problem is with the example I have up there, but this is the solution that solves mine.
Haikus are easy
But sometimes they don't make sense
Refrigerator
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|