www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: AleNovi on June 25, 2017, 11:59:58 am

Title: Transparency issue
Post by: AleNovi on June 25, 2017, 11:59:58 am
Hi there!
I have some issue with transparency:http://radikal.ru/video/evjcydyhsoc (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.
Title: Re: Transparency issue
Post by: EgonOlsen on June 25, 2017, 01:40:39 pm
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.
Title: Re: Transparency issue
Post by: AleNovi on June 25, 2017, 02:23:52 pm
I understand, thanks for the answer!