Forums > Jitter

gl shapes overlapping

Mar 07 2013 | 8:41 am

I am making a simple patch with multiple gl shapes in array, and I have this problem with overlapping. When I put shapes one over another in write order there are no problem, but when I put for example the first shape in front of the second I am losing its transparency.
Can anyone help?


  1. ScreenShot20130305at2.26.36PM.png


Mar 07 2013 | 8:24 pm

it’s not entirely clear from your patch what you’re trying to achieve, but my assumption is some kind of particle effect.

you should check out the brand new @depth_write attribute for* objects.
this allows you to have both transparency and depth_enable on certain objects.

the trick is to draw all opaque objets first (@layer 0) and all transparent objects last (@layer 1)

you may also want to checkout @view_align 1

here’s a patch:

-- Pasted Max Patch, click to expand. --

Mar 08 2013 | 10:45 am

Thanks for your replay,
my mistake! @depth_enable this is the answer of my question. Anyway your advices are very helpful for me. One more about @depth_write I am not sure that I have this attribute, in which version of max is it included? I am with 6.0.8.

Mar 08 2013 | 6:27 pm

it was introduced with 6.1.

Mar 08 2013 | 7:15 pm

Thanks a lot:)

Mar 29 2013 | 11:33 pm

Hello, can I ask one more question about ordering shapes, sorry but I am really lost in it:(

So, what I have to do if I have one videoplane object, with multiple shapes in it? How can I order it in between other shapes?
I don't know why it stays or on the top of everything or on the bottom?
Or is there other way to have 60 shapes except 60 videoplane objects?


  1. ScreenShot20130330at1.18.14AM.png


Mar 31 2013 | 7:36 pm

sorry, it’s not clear from your patch what you are asking.
i suggest you simplify your patch, give some steps to reproduce, and explain clearly what is not working.

Apr 02 2013 | 6:56 pm

Sorry I will try again.

In the patch that you send me with separate videoplane objects everything is perfect! Shapes haves transparency one to another and to the torus.
1. is when I do not use the matrix, but only videoplane like a single object, everything looks nice, like in your patch.
2. when I try to use the matrix (connect metronome to it), shape goes on the back of the torus.
3. when I push depth_write to one shape comes in front of the torus, but with out transparency to it.
Looks like, if I give to the video plane object a matrix for input instead of position message, it goes on the back of other shapes.

Sorry if my question is naive, I am new in this, and I don't clearly understand why it happens, if it is on the 1 layer.
My question is how can I order this video plane, when I want to put it in front of others, as when it was before I used a matrix for it's input?

I hope that it's more clear now.


[attachment=219807,5361] [attachment=219807,5362] [attachment=219807,5363]

  1. 3.png


Apr 27 2013 | 7:08 am

OK I have found some information about OpenGL. The only way I found is discarding pixels with shader instead of alpha, but I could not have a gradient this way.

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > Jitter