-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order independent transparency #4814
Comments
/ping @zz85? |
I slightly changed the weighting function for the demo, i.e. lowered the orderingStrength (for the terminology see the presentation on the paper website) of the weight function. Maybe its a trade-of: more ordering discrimination results in a stronger effect when zooming. I guess in a setting where you (always) zoom/scale the whole scene it could make sense just apply the the rotation but not the scaling term of the Some more notes on my implementation. I used the approach with multiple render passes. The other approach is to use multiple render targets. Since the WEBGL_draw_buffers extension is now available in recent browsers it would be nice to have that too. However, as far as I know there is no api for multiple render targets in three.js so far. I guess this is a topic for another discussion. |
looks cool... i'll need to free up a bit of my brain cycles first before looking into this... |
in your demo code,
|
Working live example: https://raw.githack.com/arose/three.js/oit/examples/webgl_oit.html |
Looks like @pailhead has also made some progress on order-independent-transparency here: https://discourse.threejs.org/t/depth-peel-and-transparency/5365 (or is that something else? It seems to solve some issues that I've seen with the order-dependent transparency) |
The demo doesnt run on ios :( |
My approach unfortunately can’t work with three unless render buffers are somehow decoupled from targets. I’ve been thinking of somehow hijacking the gl state at the right time to maybe allow for that, but it seems very gnarly. This approach might be more modern, it seems different than what I attempted. |
How is it more modern? |
I don't know need to dig into it, i figured it was written more recently since it does leverage shaders, the depth peel paper i worked off of i think predates shaders. |
Merging into #9977. |
Recently @zz85 mentioned (#4724) a technique to render transparent objects without sorting. There is a paper and a blog post describing it. Also, it has been already implemented in webgl - in cesium (example).
I tried to implement the technique with three.js. Here is a demo and the code on github.
In the demo you can switch between the order independent rendering (oit), opaque or classical transparency requiring sorted rendering. It is quite convincing - until you start to zoom. I suspect it has something to do with how I calculate the
z
value for the accumulation and revelage shader. I'll try to figure that out, but any help is much appreciated!The text was updated successfully, but these errors were encountered: