Transparency issue

Started by AleNovi, June 25, 2017, 11:59:58 AM

Previous topic - Next topic

AleNovi

Hi there!
I have some issue with transparency:http://radikal.ru/video/evjcydyhsoc
How it works now: Each not transparent cube is created as a separate object, then they are combined using Object3D.mergeObjects(not_transparent_object, current_cube);
In addition, transparent objects are combined into a second object Object3D.mergeObjects(transparent_object, current_cube);
So one layer = two Objects - one not transparent and one transparent (o3d_t.setTransparency(255))
This method provides good performance but transparent objects conflict with each other (in video yellow block and bars are transparent).
Is there any way to fix this? I'm new to the engine, so I could not notice any method that can fix it.
Thanks.

EgonOlsen

No, you can't fix that. Transparent objects have to be sorted to be rendered correctly and you can't do that once they have been merged into one object. You have to leave them as individual objects.

AleNovi

I understand, thanks for the answer!