Nope. Problem is in this case that you’re effectively drawing 2 objects in 1. When you draw semitransparent objects, the use of the depth buffer becomes tricky, because you can’t really decide at what depth the previous object was drawn. In this case, if the front object is drawn first, the depth is set even though the pixels are transparent, and parts of the second object behind the first won’t be drawn at all.

So if you want to handle this correctly (at least the way it happens in games etc), you should draw all the solid objects first (they use depthbuffer normally), then draw all semitransparent objects from back to front (with depthbuffer writing off, sorted manually, a PitA).

An alternative (which might be sufficient when you’re making some nice visual collage or art crap) is to not write to depthbuffer at all when drawing semitransparent objects. How? Forgot the command, probably somewhere in jit.gl.sketch. But this will obviously not give physically correct results.

Try switching the gate in this edited version of your patch to draw them the other way around. Good luck!

— Pasted Max Patch, click to expand. —

Copy all of the following text. Then, in Max, select New From Clipboard.

I am also fighting with this problem at the moment. Would you mind showing an example of the technique described below (or some other source of information on how to do this)? If I understand you right one would first have to set depthbuffer 1 (to jit.window), draw all solid objects (e.g. using jit.gl.sketch), then set depthbuffer to 0, draw all half-transparent objects, and then render this (bang to jit.gl.render)?
-However, sending a "depthbuffer" message to jit.window re-builds the OpenGL window (causing a flicker).

Any help/hint would be appreciated! :)

Best,
Marlon

"…So if you want to handle this correctly (at least the way it happens in games etc), you should draw all the solid objects first (they use depthbuffer normally), then draw all semitransparent objects from back to front (with depthbuffer writing off, sorted manually, a PitA). …"