Capturing multiples with jit.gl.sketch

zcwaa22's icon

Hello,
I've got a question about capturing multiples with jit.gl.sketch, im using this instead of the render to texture method so i can get rid of the background with reset, glclearcolor 1. 0. 0. 0., glclear.

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

Unfortunately the cubes aren't being rendered in the correct order, i.e some appear in front of others when they should be behind- take a look at this patch cobbled together from others.

Ive tried messing around with depth_enable, blend_enable and cull_face but im not getting anywhere with them!

As usual any ideas would eb much appreciated!

Rob Ramirez's icon

@depthbuffer 1 on the jit.window
@depth_enable 1 on the gl.gridshape that is the target of the gl.multiple
@capture_depthbits 1 on the gl.texture that is capturing the output of gl.sketch

zcwaa22's icon

Thanks Robert, i got there in the end- what a silly mistake!