Translucent Materials behind Other Translucent Materials Ignore Refraction

Shrooblord
Mon, 01 Apr 2024 20:19:59 +0000
Rendering

Hey there,

I’ve got the problem as detailed in this video:

[UE5] Translucent Refraction Problems

In words, the problem is the following:

refraction works through translucent materials, until another material that also has translucency and/or refraction enabled is seen through the first translucent object

for example: the ocean in the distance appears to render on top of where you would expect the refracted image of objects below the hill. If you pitch the camera down so you don’t see the ocean, the effect looks as expected

another example is that, given the refraction of a translucent object, we’d expect other translucent objects to be rendered “bent away” from their actual position in world space (since that’s what refraction is) – however, as we can see when I look through the crystal tree, the other objects using the same Material are seen “cutting through” the refraction and are shown as if the Index of Refraction is 1.00

Things that do work after applying fixes / work-arounds (see below):

refraction looks mostly correct (some artefacting at oblique angles but that can probably be worked on some more)

translucent materials when seen through other translucent materials are still translucent

Objects get doubly refracted when seen through two surfaces that refract (even though the second surface isn’t where you’d expect it given the first object in your way)

Things I’ve already tried, and work-arounds I’ve had to apply:

Originally I was using Substrate, but the refraction seems completely broken in this system still - I was seeing things rendered twice through the translucent materials, and then it wasn’t even actually properly refracted in the duplicate image

So this is using the UE4 Materials instead; or rather, a Substrate UE4 Unlit Shading conversion node that feeds into the Front Material (see image of Material setup, below)

Tried various Lighting Mode, Translucency Pass settings in Material Settings; tried Lumen and not-Lumen, and no Global Illumination whatsoever; tried Hardware Raytracing and non-Hardware Raytracing; set PostProcess Volume to Translucency Type: Raster (see also: UE5 severe problems when rendering translucent and reflective materials simultaneously - #20 by Durghan)

Tried multiple indices of refraction (close to glass, water, ice; the refraction in this material is closest to amethyst, which is what I’m trying to emulate here)

Any insights would be kindly appreciated!!

P.S.
I will also describe the Material setup in words as I’ve seen images on this forum break over time during migrations to different forum software; so for future Internet peoples…:

Substrate Material

Select root node

Blend Mode to TranslucentColoredTransmittance

Lighting Mode to Surface ForwardShading

Translucency Pass: After DOF

Refraction Method: Index of Refraction

DistanceFieldApproxAO node with default settings (BaseDistance=15.0; Radius=150.0; Num Steps=1; Step Scale=3.0) plugged into root node’s Ambient Occlusion

ScalarParameter IndexOfRefraction with default value 1.545 (IoR of amethyst crystal) plugged into root node’s Refraction (Index of Refraction)

Substrate UE4 Unlit Shading (UE4US) node plugged into root node’s Front Material

using Material Function: SMF_UE4Unlit

3VectorParameter plugged into UE4US node’s Color (V3)

value: 0.4; 0.5; 1.0; 1.0

ScalarParameter CoverageWeight with value 0.6 into Opacity (S) of UE4US node

23 posts - 5 participants