@ online2
There are a few approaches like CCRenderTexture.
If the texture doesn’t need to be updated frequently, display.save() is available.
If the results are needed immediately and can then be fed into another effect, multi-pass is an option. (This is the first thing I tried, but generator.random was updating too and the circles effect did not appreciate it. :D)
Last but not least are snapshots, which as you saw I ended up using (never further refreshing it after its initial capture). You can apply a fill to a snapshot, as I did. Unfortunately, these cannot yet be used as inputs to paints, normal or composite. :( There were some hints from Walter that this would be coming, but I think it’s gotten lost in the shuffle. Once this happens, though, the fancy effect floodgates will be wide open.
Stripes shouldn’t be too hard to do. If you saw IcySpark’s fires effect earlier in the thread, for instance, it has this snippet:
P\_UV vec2 q = uv; q.x \*= 5.; // SNIP q.x = mod(q.x,1.)-0.5;
which basically breaks the region horizontally into five unit-width bins, then centers them. It isn’t a huge leap from bins to stripes, e.g. before that final line there could be a test like mod(q.x, 2.) > 1..
Something like that will be straightforward for horizontal or vertical lines. You can move to angled ones by using vectors. Basically, if you have a unit vector (x, y), it will have perpendicular vectors (-y, x) and (y, -x). Then you’d have a set of points going from some origin, (x, y), to each displacement by an integer multiple of one of your perpendiculars, e.g. adapting the above snippet, (x, y) + t * (-y, x) where t goes from 0 to 4. Using vector projection, you’d first find out where your current uv would land on that perpendicular line, and probably snap it to one of the intervals. That would give you a starting point for a parallel (x, y) ray, and you could do another projection to land on that.
(This might make more sense with a picture, but I don’t think I’m up to it just now. I’m not sure if it’s helpful, but if you saw any of those shader shows, this was one of the “rip” effects I demonstrated, and uses an oriented segment; basically, it masks out pixels close to the segment. The other two variants are in that same directory. There’s a link to a mostly up-to-date version zip file of the project earlier in this thread.)
Each projection would give you a distance, as you’ll see if you read the vector projection link. These are basically rotated versions of x and y, and the same technique used by the fires can apply.
Once you’ve established you’re on a stripe you can play with it, of course. Alternatively, you might try to reverse your position and land on a stripe. I’ll leave it there, for now, or I’ll never get this posted.