Separate Translucency in Underwater Post Process Material

@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