Any way to render reflections behind translucent glass surfaces like in modern games with ray tracing, and also how to get proper refraction, without ugly mess on screen, I tried both way to render with Translucency set to Raster I can’t use refraction and don’t have reflections behind glass, with Translucency set to RayTraced I get slightly better refractions, and reflections on other surfaces when looking through the glass, but in reflections I have no lights and shadows, and other translucent surfaces is completely opaque, so both ways are a complete mess only option are left is PathTracing, but it’s not an option, how to resolve this, glass surfaces are a most common thing in any scene for now UE5 is useless, I will put some screenshots later
Here are the settings, all turned up to the max.
After three months of research, The only thing I want to ask is…
And how to fix it? Because I know it’s possible, we’ve seen it in many games with full RT and also with PT
Translucency shouldn’t be set to raytraced when using Lumen as it doesn’t support any of Lumens features, so you won’t get GI or indirect shadows in reflections. Also pretty sure it is deprecated and Epic is not fixing any of the problems with it so…
When using rasterized translucency you can’t use realistic IOR values for materials, it behaves as though the “ray” never exits the medium and so it it will be bent way more than it should. Rasterized refraction is a screenspace effect so if the rays go off screen you’ll just get a hard edge and then the refraction effect just vanishes, if they hit a foreground object then the foreground object will show up in the refraction.
If you ask me IOR should have never been added as an option since you effectively can’t use any real IOR value with rasterized translucency, which is the only translucency method worth using. But I don’t make the engine so…
Raytraced refraction for Lumen is still a WIP as far as I know, in theory it should solve these issues and there’s a check box in project settings for it but it doesn’t appear to do anything for me in 5.5. Others have experimented more with it in the Lumen feedback thread so you can likely find more info on how to get it working there. I say, “in theory” because there are still likely to be limitations with it, particularly when it comes to Nanite meshes.
This is just an inherent limitation of Lumen’s reflections, only the first layer of translucency can have high quality reflections.
The TL;DR version is: Translucency in Unreal is a mess, it has quite a lot of feature conflicts that are not well described. To some extent this is unavoidable, due to the way all the features work. You’re not going to get glass rendering that matches the path tracer in every context.
the raytracing scene is currently solid. you cannot trace thru objects, unless they have a masked texture. refraction is limited to screenspace. i dunno if and how raytraced refraction works, currently. it’s been limited in the past too, tho.
also… translucent objects don’t exist in the raytracing scene they are composited later. hence why you cannot raytrace glass to see it reflect glass. glass will reflect a mirror once. but a solid mirror can not reflect a translucent glass surface.
you can however use dithered glass to get a decent semi translucent look at 50% opacity, that supports multiple bounces. or atleast looks like multiple. it turns into a solid mirror after the first bounce. no refraction obviously, cause it’s basicly solid pixels, temporaly stabilised. and the other issue with that is, it’s highly unstable due to dithering. neither does it cast proper shadows. the dithering doesn’t align with light vectors to get a correct pattern. i tried that a couple times and failed. so… w/e
The problem I have in my scene is that I have two layers of glass and curtains. You can see them on the right. I can’t properly render anything with them, so I use a “wannabe glass” material and completely opaque curtains instead.
What bugs me the most about it is that yesterday I played Spider-Man 2, which has all sorts of ray-traced reflections and refraction, and it runs at 120 FPS on my PC.
This actually isnt true. RT translucent can sample the lower res lumen translucency volume for GI. In some cases, the lower resolution may result in noticably worse results but it’s good enough for many uses.
As for OPs question, enable “Order Independent Transparency” in your projects settings.
For flat panels of glass, like windows - I wouldn’t use refraction at all. Technically it does refract like all glass, but the light bends back into the original direction as it exits the other side. So unless the glass is extremely thick, curved, or the surfaces aren’t parallel the refraction is basically imperceptible.
This is why when you look out a window, you don’t really notice the light rays bend. There is no point accurately simulating this effect in that case. This will allow you to use raster refraction translucency and avoid the problems with RT translucency.
Unless you’re putting glass sculptures in your scene, physically accurate refraction will add little to nothing of value.
i’m not aware of any way. i could try to find a way to stick it to a consistent screen space pattern. that’s all i can think of, rn.
well… i modded the pattern from the DitherTemporaAA material function to the 50/50 ratio. its does not propagate thru the reflection bounces tho. i’m lacking some math knowledge there, what the coordinates are in the reflection. i reckon this should be a ray payload.
neither taa nor tsr are able to denoise it, anyway.
You can offset the pattern of the temporal dithering manually on a per mesh basis so that different pieces of glass are drawn at different times. This will allow as many pieces of glass as you have frames in your dither TAA to blur together with reflections. Off the top of my heard I think the dither has 5 frames by default. This requires altering the HLSL in the custom node.
Doesn’t change the fact that dithered translucency often looks pretty bad as you say, so OP I would only use it if your goal is to maximize performance - not quality.
Pretty sure it doesn’t. I think the default dither applies the same screen space pattern everywhere, so if two dithered objects overlap, only the closest one is visible.
Can’t test this second, but I know I’ve had to fix that in the past for certain effects.
aight. i thought i read the temporal length is 32. according to internal error/crash log the taa sequence length is 8. x) can totally debug that. it’s infact 9 samples. i will play around with that. that should allow 8 or 9 surfaces. gonna be noisy tho, i reckon.
Correct, I believe the default length is 8 - but I don’t think the dither TAA node has 8 frames in its pattern. This is easily adjusted though, you can have the lesser of TAA frames and dither pattern frames.
Yeah, I needed to change it to get two sided glass like bottles working with dithering in the past, making the backface pattern offset a bit. It’s a handy trick.
I find that dithered translucent works best when the depth difference between the dithered object and the background is small. Then the motion vectors don’t get too whacky, and the smearing is kept to a minimum.
yeh. this is not about translucency only. in this setup it works with translucent materials, even. still can’t get a reflection. the red uses a 2 by 2 pattern. the green and blue uses the inverse. the red and green “blending” obviously works. still can’t reflect the red in the blue nor the other way around. you hit the blue and you raytrace in the bvh. it’s not like you have a screen position that you can use to generate the pattern of the red reflection.
i thought i could do it, but i don’t think this works like that. i even tried to shoehorn full opaque frames in the taa history, but it ended up flickering and it’s still not stable in motion. fun experiment, tho. : )
Yeah, reflections are another can of worms. Personally I would just make it fully opaque in the reflection pass. But that’s because I’m mostly concerned about real time applications and have multiple layers of glass with inter-reflection inside of a reflection is not really justifiable or even noticable there.
As long as I can’t see the same surface behind the glass, it looks great. But…
When I can see, weird things are happening. Why do I get sky lights in reflections? I don’t know.
If you’re using RT translucency with Lumen, it uses a low resolution translucency volume for GI, which is prone to leaking. I would simply not use RT translucency for flat planes of glass - use raster. It should not have any leaking, and unless you need refraction (which you don’t for that case) the quality will actually get better, not worse.