It occurred to me yesterday that, it would be possible to render ‘slices’ of the Voronoi texture on a series of sprites arranged in 3D space, to give a kind of volume rendering effect.
I’ve thought about this before, but it’s always meant running some kind of shader inside an Iterator, and the whole thing would crawl to a halt.
My brainwave yesterday was that I could use the Queue to eliminate the need for the texture to be generated inside the Iterator. All you have to do is change the texture, and every change made adds another item to the Queue, and you end up with a 3D map of the changes to the texture over time, as each new image pushes the Queue along and each sprite is updated with a new texture.
Here are some examples of my cheap volume-rendering in action:
The macro/DOF type effect is simply the result of applying a circular vignette to the alpha, so it fades out a little around the edges. I’ve also added a small square vignette around the edges of the texture to help smooth things out when the volume is rotated. Of course, since it’s just a stack of 2D sprites (50, in this case), when viewed near edge-on, the illusion of a 3-dimensional volume disappears, and you get all kinds of nasty glitching. If I ever decide to finalise this experiment, and setup proper controls, I’ll limit rotation so you’ll never see this though.