Author Topic: Transparency issue  (Read 126 times)

Offline AleNovi

  • byte
  • *
  • Posts: 10
    • View Profile
Transparency issue
« on: June 25, 2017, 11:59:58 am »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11770
    • View Profile
    • http://www.jpct.net
Re: Transparency issue
« Reply #1 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.

Offline AleNovi

  • byte
  • *
  • Posts: 10
    • View Profile
Re: Transparency issue
« Reply #2 on: June 25, 2017, 02:23:52 pm »
I understand, thanks for the answer!