jit.gl.mesh self transparency problem

Jul 16, 2013 at 7:29pm

jit.gl.mesh self transparency problem

Hi,
I’d like to play with geometry and the mesh object but, I really need transparency of rendered “objects”. But as you can see from the attached patch and image, it cannot render transparency properly, it doesn’t render at all…

Thank you.

<code>

– Pasted Max Patch, click to expand. –

</code>

Attachments:
  1. transparency
#256240
Jul 17, 2013 at 4:20am

transparency in OpenGL (the technology Max uses) is not automatic and perfect. It is just the way that OpenGL is designed and implemented.

A large part of getting transparency to work like you probably want it to work…is to change the drawing order. You need to draw the items furthest away from the camera first, and then draw them in order moving towards the camera. This includes things like the mesh. In your example, the mesh is drawing in an order which makes the transparency not able to perform well. If you rotate the mesh using @rotatexyz -5.469016 -133.987686 55.153473, then the transparency behavior is better. This is because in that rotation, OpenGL is drawing the segments of the mesh furthest away from teh camera first.

This is a normal part of learning OpenGL. And dong self-transparency is a particularily tricky part.

#256269
Jul 17, 2013 at 7:16am

Try messing around with the @blend enable and the @depth enable settings. I plug my jit.gl.model object into jit.gl.node and then send that to a videoplane. This lets me keep the transparency and makes it easier (for me at least) to decide the drawing order of multiple objects.

#256276
Jul 17, 2013 at 9:21am

Thank you very much Diablodale, I’ve already met the render order issue, I did not think it was one of those cases.

I’ve solved with a simple GEN patch.

Andro, I think you didn’t get the problem, with other objects the alpha is ok, but, I was looking for self transparency.

Here is the modified patch.

<code>

– Pasted Max Patch, click to expand. –

</code>

#256296
Jul 18, 2013 at 4:45am

The patch you posted might work for the specific orientation of your sphere. However, if you rotate it in any way, it is likely that the vertices will no longer enable you to just reverse their order (using your gen sampler). To solve the general case that works all the time, you would need to do sorting. And…sorting can be non-trivial because of the many cases of overlapping and slanted polygons.
Its a fun problem to tackle. :-)

#256360
Jul 18, 2013 at 5:48am

Yes, I know this, ordening in this complex system(for me) can be a problem, I’ve already did some fake 3D or 3D ordening in processing, but it was a system totally generated by me and it was a simple system.

I think I will live with this issue and show to the camera only the right face.

I did this patch just to try, maybe I won’t use the GEN order reverse and I will implement some kind of reverse on the rotatexyz degrees.

#256362
Aug 4, 2013 at 1:33pm

Hey, I’ve found a workaround just on this forum posted by Rob Ramirez, I’ll try soon.

http://cycling74.com/forums/topic/blend-mode-alpha-jit-gl-texture/#post-238808

#257995

You must be logged in to reply to this topic.