Since UE4 went public in 2014 I know there’s been mumbling about improved transparency solutions to be added into later builds of the engine. Recently I was reading through Ehamloptiran’s Hair Rendering thread and saw stochastic transparency mentioned as a possibility, which appears to be similar in principle to an old post (for another engine) I read a while back on stippled transparency for deferred renderers.
My question is whether type of lighting-correct (and order independent) transparency rendering is viable and possibly a planned (or something similar)? Treating transparent surfaces as opaque for the purposes of unified deferred lighting would be fantastic and eliminate all the issues we’ve been dealing with regarding correct cubemap depth, SSReflections, and proper dynamic highlights, but I have no idea how expensive it would end being to get the effect looking nice and smooth after the layers of dithered pixels have been blended together.
Anyway, I hadn’t seen it mentioned in a while and wanted to bring it up to see if is a possible solution that’s being looked into or something that’s already been determined to be too expensive.
I downloaded and built the latest version from the branch on GitHub (shows up as 4.8) the other day and found SSR for translucency is working, all you need to do is turn it on in the material settings. There is also a second lighting model for the old TLM_Surface, which has been renamed, that works on a per pixel basis. It requires “r.ForwardLighting 1” to be set, which is very interesting as a Material-Based Forward Rendering solution has been mentioned as an upcoming . So the answer your first question is yes, and it looks like it may be coming very soon.
One thing to note for the translucent SSR is that it added 100+ instructions to my ocean material, which is roughly 650 instructions before SSR. I am not sure whether scales with the complexity of the material, or if its 100 instructions added to any material, will need to investigate some more.
So material based forward rendering is the planned approach to improve translucent surfaces, along with planar reflections for translucent surfaces, and it seems to be in progress.
Here is a quick video thrown together, it’s dynamically lit with a couple of meshes (I will redo video with a better scene soon) as a test to show the reflections are working:
It’s all still a work in progress and the video above was a really quick test, and you need to build from the on GitHub to have access to it, but hopefully that helps answer your questions.
Oooh nice! That ocean shader with the SSR looks great!
I’m glad that a transparency material shading solution is starting to materialize
Although a couple aspects of the stochastic method (or something similar) that interested me were that it would be both order independent and allow for some of the potentially more complex deferred shaders to be used on transparent surfaces.
By order independent, I’m referring to something like or . Note that these use different techniques, and stochastic transparency would likely be a bit softer/fuzzier as it would be blurring fewer pixels from each transparent depth together. But having an order independent solution would allow us to do some cool stuff like the mech in the second video as well as avoid nasty alpha sorting issues in things like hair.
That said, I’m unsure how expensive the rendering and blending processes would be for the stochastic method and if it’s something Epic and looked into and discarded or is still playing with? Either way, I’m really happy we’re at least getting **some **method of transparent shading that won’t look so out of place with every other material