How to cross fade two jit.gl objects ?

azahn123's icon

I have two working sets of gl 3d objects ... I want to be able to cross fade two or more sets / objects.

DiGiTaLFX's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I assume when you say gl 3d objects you mean gridshape/sketch/mesh etc as opposed to just textures on a videoplane? If so, then try the following

DiGiTaLFX

azahn123's icon

This is great ! But ... Now how to I grab / adjust atributes of each of the two shapes ?

DiGiTaLFX's icon
Max Patch
Copy patch and select New From Clipboard in Max.

It's just working how the patch would normally work, except rather than rendering the shapes to the window, they get rendered to a texture and that is then shown on a videoplane. But it's all happening live. So just deal with the shapes as you normally would e.g.

DiGiTaLFX

azahn123's icon

Here is the patch I am trying to x fade ... The two sections (one on top and on bottom) are the two separate graphics I want to x fade... But cant figure it out ... And when I attempt to use your method I get errors...

3233.17.TwineBallsnow2BallsTestOnline.maxpat
Max Patch
Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you bind the gl objects for each "scene" to a separate gl.node object (simply by connecting the middle outlet of the gl.node to the gl object you want to bind). set @capture 1 on the gl.node, to output the "scene" as a texture, and then blend the textures as demonstrated in the previous patch.

azahn123's icon

Thanks To both of you ! The only LAST issue I am having is that in my original patch... I am using the attri "Erase Color" to "blur" or "multiply" the lines that are moving ... For some reason, after Robert created the x fade from my original patch, the blurring went away...

DiGiTaLFX's icon

I believe the easiest way to do that is to add a jit.gl.camera to the node and set erase_color on the camera object. However maybe Robert knows of a better way?

DiGiTaLFX

Rob Ramirez's icon

there is a jit.gl.pix example patch that shows how to do this.
simply set @erase_color attribute of your jit.gl.node to 0 0 0 0, and place the jit.gl.pix objects found in the following patch, in between your jit.gl.node, and your xfade'r:

Max6/examples/jitter-examples/gen/smear.o.vision.maxpat

Eric Souther's icon

I can't seam to get Spout textures to work in a jit.gl.pix @gen xfade, what am I doing wrong?

Max Patch
Copy patch and select New From Clipboard in Max.

Rob Ramirez's icon

you need to enable @shared 1 on both jit.window contexts

Eric Souther's icon

Worked like charm thanks Rob.