Recipe 56: Relief
- Download the Recipe 56 patch
- Other tutorials in this series:Book 1 (Recipes 00-12), Book 2 (Recipes 14-25), Book 3 (Recipes 26-43), Book 4 (Recipes 44-49)
- See all Recipes
- Creating evenly spaced 3D objects
- Making a 3D volumetric relief effect using video input
To make volumetric objects like clouds, 3D developers will often use evenly spaced texture planes that represent different slices of the object. For this patch, I wanted to create a 3D relief effect using video luminance based on this idea of stacking planes.
To create the effect, we start with 5 layered, evenly spaced jit.gl.videoplane objects. To do the positioning, we give each jit.gl.videoplane it's own jit.anim.path object. Since each jit.anim.node is parented to the one behind it, sending the same position value to all of them will result in an evenly spaced set of planes. The rotation is done on just the topmost jit.anim.node and all the videoplanes move as if they are a single object.
The next thing this effect needs is to take the video input and create luminance-based slices. To do this we do a simple lumakey using a couple of jit.gl.pix objects. One of the jit.gl.pix objects is just used to create a luminance image (similar to jit.rgb2luma for textures) that is passed to the right inlets of the other jit.gl.pix objects. The other jit.gl.pix objects are all identical, and take the right input and generate an alpha channel for the texture based on a threshold luminance value. The resulting textures are applied to the videoplanes.
by Andrew Benson on
Jun 15, 2012 5:17 PM