MatterHackers / MatterControl

3D printing software for Windows, Mac and Linux
http://www.mattercontrol.com/
BSD 2-Clause "Simplified" License
457 stars 184 forks source link

Implement Order Independent Transparency #5177

Open larsbrubaker opened 2 years ago

larsbrubaker commented 2 years ago

Investigate and implement better transparency for the mesh renderer.

Dual Depth Peeling

NVidia paper on depth peeling.

Here is a great example in WebGL, this is where I would start with understanding a clean implementation.

It is important that this only render the actual 3D scene multiple times and not the rest of the UI. All passes must be constrained to the 3D view.

Weighted, Blended Order-Independent Transparency

Here is another technique that may actually prove to be a better solution (at it has source code that could be ported). Here is the original paper by NVIDA.

There are also some nice videos of it on youtub. video 1 video 2

Another great paper.

Requirements

NOTE: Make sure the GLFW renderer is active when solving this issue. Enable Line 234 in Program.cs

Updating open GL to 3.0 or even directly to Vulcan is perfectly fine. Deprecating and removing the existing bridge code is also fine as long as we're on top of GLFW and both Windows and Mac work correctly.

We use GLFW so that we have a layer for Windows, Mac and Linux. It's important that we can continue to run on all of those platforms. My understanding is that the version of GLFW on Mac has both an open GL 3 layer as well as a Vulcan implementation that can run on top of metal.

fortsnek9348 commented 1 year ago

These bounty labels disappearing doesn't seem great. Is there still a bounty on this one?

Some of this stuff might need multiple passes, so there may need to be a higher level rendering interface passed to all these drawables.

Also would like to fix some things up. Deduplicate some code maybe.

Vulkan is a fun idea, but it's a massive change in how things are done. But well, if the raw graphics API calls are moved out of application code, it would be more feasible to flip flop between graphics APIs.

larsbrubaker commented 1 year ago

Sorry about that. We got rid of our bounty program as there was very little participation and the overhead of it has not been worth the time. We would still love the contribution but it would have to be for the good of the project. :)

Thanks for all the work you have done and all the interest you and everyone has had in the project.