Separate Translucency in Underwater Post Process Material

(UE 5.3)

I’m making a post process material for the Water System but when the camera goes under water at a certain point, it looks like the Separate Translucency render target get disabled as you can see on the pictures below.


On the left : camera is above the point, right : below the point.

So It’s not when entering the PP volume, and I’ve tested with the water surface disabled and the same happens. I’ve checked the settings of the WaterBody and WaterZone, but nothing seems related (or I missed it).

It’s not bad at all, because I don’t want to have the reflection capture on my translucent materials if they’re underwater, but I wanted to sample the Separate Translucency Alpha in my underwater PP material just to make a mask and prevent them from being fade out by the far fog that is sampled on the scene depth / custom depth.

Another bad thing is, as you can see on the first (top-left) picture, the reflection capture is still visible on the glass, so it vanishes in one frame when going lower. So I may consider disabling Separate translucency in the whole project, in that case, how could I still have a way to sample the translucency ?
Edit : It is actually not only the separate translucency that vanishes, but more likely the whole translucency that is no more deffered (Or I don’t get what’s happening).

I’ve to mention that I cannot use custom depth writes of the translucency, because the results are not good, and I don’t use clip plane position to determine where the pixels are underwater, but I sample the scene depth and custom depth on a huge invisible box at the ocean’s bounds to make this computation, so it would mess with it.

I’m really not a render pipeline expert, so any help for comprehension would also be appreciated, also if there’s another solution to achieve what I’m trying to do, I would love some hints. :slight_smile:

Somewhere in Epic’s documentation is a graph illustrating the entire process of their rendering system. While I don’t currently know where to find it, I think it may be useful to you: Single Layer Water is its own custom rendering paradigm in Unreal Engine, and it tends to break transparency from what I’ve seen. Wish I knew more, but SLW+additional translucency is a pretty hard problem on its’ own.

I couldn’t find the said graph, but thanks now I understand better what’s causing that. I’m now almost certain using custom depth write is the only way to go.

To add more details to this thread, that’s what we’re currently having:

Using some logic with distance fields and Stencil mask, we can mask out the water surface from inside a mesh, and also the PP effect when looking from inside, or from above water (that’s why we need a huge invisible box).

I will return to this post if we get to workaround the translucency vanishing when going under the SLW mesh.

Wow, that is an extremely impressive effect and a very hard problem to solve with any sort of water rendering, amazing work.

Out of curiosity, have you played around with the order-independent transparency system at all? Just curious how that would interact with SLW.

Out of curiosity what are you using the distance fields for? Are you sphere tracing to find the interior?

@jblackwell Thanks and yes I’ve tried, but SLW is opaque or masked so it doesn’t affects the order of rendering. Yeah it’s very complicated and there always new limitation I encounter, e.g. the shader on it’s own can’t handle a second glass bubble if you’re looking from inside one already, it will require some high level logic to change the states of the actors in the level to fix that.

@Arkiras I’m sampling the DistanceToNearestSurface (on global distance fields) and yes, if the distance is negative then it is the interior. So for the PP material I check the clip plane positions to determine which part of the screen is inside or outside the mesh, therefore I can change the logic depending on this state. It requires some tricks to get a correct occlusion inside the mesh : I have several instances of a simple sphere mesh inside of this bubble, all set to “render in scene capture only” so they’re invisible. For the SLW surface I simply use it on the opacity mask.

2 Likes