Trying to understand UE4's translucency once and for all

Hey all! I’ve been avoiding translucency for a long time because my impression was that it didn’t play nice enough with the deferred renderer to be worth using in most cases. I’ve looked at dozens of threads and videos about it without really getting it. BUT I’m doing projects with glass and other potentially translucent stuff and I decided to try and get a handle on it.

To that end, I made a big grid of translucent materials with various different settings.


So now I have some questions:

  1. What does Translucency Vertex Fog do? I could see a very slight difference in some of the materials, but not enough to have a sense of what I’m looking at.

  2. Is the Separate Translucency Pass supposed to make things look like that? Even at 100% opacity they’re very easy to see through, like they’re using additive blending or something. Nothing I’ve read or watched about the Separate Translucency Pass seems to mention it causing such a drastic change, but there it is. What’s the deal?

  3. The only two that seem to look good, for my purposes, are the Forward Shading and AlphaComposite settings. To my eyes, the AlphaComposite mode looks slightly better, but everyone else seems to want it for FX. Is there a reason not to use it for translucency on ordinary meshes? Is it more or less performant than the Forward Shading setting?

Thanks in advance! Hopefully some of this is helpful for other folks as well.

1 Like

AlphaComposite is actually very slightly faster to render than ordinary alpha blending because it uses one fewer blend operations, it just adds an extra step to your content pipeline to premultiply the alpha channel into the color. It is also a strict superset of alpha blending and additive, letting you use both in a single material depending on the content of the alpha channel.

Forward shading is quite expensive. It should be used only when you want detailed realtime lighting on your translucent surfaces, like shining a flashlight on them. Other modes use light probes which are far cheaper to compute but do not capture small scale changes in lighting. To get specularity, you need to use reflection capture probes and use static lights.

Alpha composite is way to go to all pbr transparent surface shading. Good example is very thin and clean glass. You really need to make difference between transmission and reflections. Opacity fakes transmission but without alpha composite it’s also dulls down specularity. Water is also material that need very special care.
Basic principle to make transparent surfaces is to start with fresnel. Fresnel tells ratio of reflection and refraction. Reflection is easier to get correct. Planar reflections, SSR, reflection probes, combinations of these usually work well enough. Refraction is harder. You somehow should calculate thickness of volume that refraction ray travels. You then multiply this by density(absorption + scattering. These should be chromatic) of volume. This is used as beer-lambert law states.


e^(-distance*density)

Then you have Transmission rgb value. This is then used as multiplier for refraction ray results. You usually can take offset scene color sample and hope for the best. If using scene color is not possible you can average transmission value and take inverse of it and put that to opacity.
For inscatter from transparent material you need to approximate even more. Just always remember to multiply this with fresnel output.

Thanks for the quick reply! It hadn’t occurred to me to use static lighting.

It looks like it works for the Surface TranslucencyVolume, although the static specularity is definitely a lot less convincing than the realtime stuff on the Forward Shading and Alpha Composite spheres. The use cases I’m thinking about are stuff like jet cockpits, car windows, etc.

I think I follow–so for transparent type materials I should start with Alpha Composite and then work on emulating the physical characteristics of the material?

Yes if you want nice looking surfaces.

Another option is to use the screen space reflections switch on the material, that will allow it to have sharp and accurate specular reflections. Of course those have some limitations and are performance heavy, but combined with reflection capture probes they can give very realistic results especially for smooth surfaces.

Take a look at the 4.14 changelog, they have made it possible to use translucency with features much closer to parity:

https://docs.unrealengine.com/latest/images/Support/Builds/ReleaseNotes/2016/4_14/image_16.gif

Hey , i like to know about Separate Translucency too , i can’t find any doc about it , what does it do ? if i only have a foliage with Translucency leaves only nothing else can i turn off Separate Translucency from project setting ? or i will get some quality issue .btw i use post process just to change scene color .

Separate Translucency renders all translucent materials to an offscreen buffer, then composits it on top of the opaque geometry at the end. I believe the main purpose is to allow motion blur, depth of field, and other depth based effects to work correctly. It might also be possible to use this to draw translucency at a lower resolution.