jit.gl.layer ratio and Z position

Matth's icon

Hello, I would like to know if there is a way to keep the ratio of a video like jit.gl.layer, but with the possibility to change the position on the Z axis. Merci!

Rob Ramirez's icon

you can do something like capture the jit.gl.layer to a texture with a jit.gl.node set to adapt 0, and set the dimensions to the same shape as your geometry rectangle.

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

Matth's icon

Thank you Rob, but my project work with alpha channel do you have a solution to preserve it

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

Rob Ramirez's icon

to preserve the alpha in the node capture, you must set jit.gl.node erase_color to 0 0 0 0.

to make use of the alpha with your videoplanes you must enable alpha blending and disable depth (@blend_enable 1 @depth_enable 0).

however if you disable depth, then you can no longer layer based on z ordering, and must explicitly layer using the @layer attribute. depending on how complex your needs are, it could be quite simple to determine z distance and change the layer attribute based on that distance.