Weighted Blending Order Independent Translucency

Ok, i fixed the remaining stuff and got rid of the workarounds, it ended up as a quite simple filter. One benefit over the current translucent bucket filter is that it is stable for overlapping translucent object. I think i was able to implement basic functionality of a simple refraction mode, but i have to test that on the real materials.

I am going to clean up the mess, and prepare a first PR for the added functionality (At gl level). One added feature is to clear color render targets individually to a distinct color. (In a MRT environment)
This one is quite simple.

The other feature i required as different blend equations for the different color targets. This one is quite messy, and the managing code for BlendModes gets bloated further. (This would be a candidate that requires quite a refactoring at some point, since there are even more BlendModes in the gl spec)

As for the filter, i would have to add them to the core as well since i requires changes to the default material. I would prepare a glsllib and add the required defines and method calls to the Unshaded and Lighting fragment shaders.
As for PBR, i think this is the feature missing for some of the extionsion. ( IOR, Tranmission, Volume) but this requires more shader modifications as well as importer support.

Alternative is to publish the filter as user project and everybody wanting it has to apply the (simple) changes to the j3md and the fragment shader

Face cull mode is off in this example
The color of the solid box in the center gets preserved much better in this
No flickering due to sorting errors since it is order indepenent

As a last note, this is of course an approximation for gaming. It does not generate CORRECT but plausable results. The author also published an extension, the glslib would already have everything in place to support that as well but it is unused currently since i have not yet figured out the math.

Additionally since you are left with a corrupted color/depth buffer this filter should be added after all other filters working with depth and color. Depth of Field for example


Just a note: At least on gif, when red cover yellow+light-blue ones, there seems to be some wrong color on part of light-blue one.

1 Like

It is because the red one intersects with the light blue one. so the part inside of the solid block does not have its backface rendered.

Is is part of the game.

In most usecases i think you would use back face culling. Its user choosable. I use no culling because sorting issues are far easier to setup that way