Three.js: Transparency and DoubleSide: A bottle neck of shader code or WebGL limitation?

Created on 17 Jun 2017  路  12Comments  路  Source: mrdoob/three.js

Description of the problem

From history, I got many answers of limitation of WebGL on self-transparency with double side.
However, recently I use sketchfab viewer and see very good result.
I think we should be able to do it in threejs, too.

screenshot 145

screenshot 146

Three.js version
  • [ ] Dev
  • [x ] r85

    Browser
  • [x] All of them

  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Question

Most helpful comment

I think we should be able to do it in threejs, too.

You can.

material.depthWrite = false;

Or, render front faces and back faces separately.

All 12 comments

I think we should be able to do it in threejs, too.

You can.

material.depthWrite = false;

Or, render front faces and back faces separately.

Disable depth write is not solution.
I will try to render front and back separately then.
Thanks

Hi, Rendering 2 times for 2 sides is not solution, it is same with Depth Write Disable.
Disable Depth Write means wrong depth order, you cannot get as good result as Sketchfab.
Do you think Geometry Face Ordering work?
I think we should support this feature. Without it, I alway heard it is rendering bug or limitation :)

Please show a live example demonstrating your use case, and explain why you feel neither approach is satisfactory.

Hi, please just use Threejs sample, I configed like this:
depthwritedisable

Please provide a live example of self-transparency _that renders properly in sketchfab_, but not in three.js.

Here you are
https://skfb.ly/68GTv

this is almost perfect
https://skfb.ly/R6tZ

As you can see, even Sketchfab can't get transparencies right. Transparencies is one of those unsolved problems in realtime graphics. You can get things to look right, but you need to understand the problem well.

Hi, although it is not perfect, I cannot see any problem with face color like our threejs.
Do you know what that it?(You can easily see dark and bright triangle in threejs screenshot)

Do you know what that is? (You can easily see dark and bright triangle in three.js screenshot)

We can't answer that question because we do not know what you are doing.

Hi, ok, I knew issue now:
When I apply sortFacesByMaterialIndex to save performance (for some big geometry like this discussion https://github.com/mrdoob/three.js/issues/11510).
Transparent issue come like this:

Before:
screenshot 150
After:
screenshot 149

(Notice Triangle line)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boyravikumar picture boyravikumar  路  3Comments

scrubs picture scrubs  路  3Comments

filharvey picture filharvey  路  3Comments

seep picture seep  路  3Comments

danieljack picture danieljack  路  3Comments