Download

Problem using Ray Tracing and windscreens / glass material. Any suggestions?

Hi,

I have a car in a scene where Ray Tracing is enabled. However, I am having an issues with the windscreens where one side is good but the other is not. And when lowering the Max. Refraction Rays it works better but not perfect.

Why is this?
Any suggestions on how I can make this work better?

Front side: Looks good.

Back Side - Not good, cant even see trough the window.
6653929287cf88e988e8c925ae8b9aea28add335.jpeg

1-sided mesh, Max. Refraction Rays 1

Outside - Looks good
020233b40964d3de4917c5de6b838e997ae1e87a.jpeg](http://filedata/fetch?id=1822425&d=1602754005)Inside - Not good, not able to see trough the windows.
c814486bb613dfb099b3d2162950fb4e1587a03f.jpeg
https://forums.unrealengine.com/core/image/gif;base64
​ [HR][/HR]

1-sided mesh, Max. Refraction Rays 3

Outside - The first windows looks good, however, the other windows look bad.
30f6f9e850c73da328e8d7040ee0fc38e0a31735.jpeg](http://filedata/fetch?id=1822424&d=1602753979)
https://forums.unrealengine.com/core/image/gif;base64

Inside - Not good, can’t see trough any of the windows.
61fdc743c5b3d3a3f0deee2b8ecb0a2e48bcc3cd.jpeg
https://forums.unrealengine.com/core/image/gif;base64
​ [HR][/HR]

2-sided mesh, Max. Refraction Rays 1

Outside - Looks good
e0c21a113a9c69fe50ae447840b014a5b8a9dd2c.jpeg
https://forums.unrealengine.com/core/image/gif;base64

Inside- The glass looks good, however the infotainment and buttons has gone dark.
3cfbe73a78e2d02c21797b991e2f5912e3cb0faf.jpeg
https://forums.unrealengine.com/core/image/gif;base64
[HR][/HR]
2-sided mesh, Max. Refraction Rays 1
Outside - Not good ad you can see.
1e0627a87ad9c67ff1e78ee8c88572b897ca2113.jpeg
https://forums.unrealengine.com/core/image/gif;base64

Inside- Not good, however, now the infotiament system looks better… but the buttons are dark.
680c7d8dc4df43fb4b72bdd15a6791413bfcb09a.jpeg
https://forums.unrealengine.com/core/image/gif;base64
​ [HR][/HR]

Settings used in post processing:
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_205087_1602755959020_868”,“title”:“screenshot.2020-10-12 (7).png”}[/ATTACH] [HR][/HR]
Using Raster instead

Outside - Not as nice as we do not see as nice reflections, but behaves as expected.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_205088_1602756114532_37”,“title”:“screenshot.2020-10-15 (2).jpg”}[/ATTACH]

Inside - Look fine and the buttons and infotaiment system is expecting more as desired.
cf03c42ceb2c59107e5fba0c01963871ee2fd06f.jpeg

Updated the post, it was a mess.

The RTGI is set to 2 bounces, while RT Reflections is set to 3 bounces. Could increasing RTGI to 3 correct some things?

2 observations:

SSR is enabled at 100/100 (intensity/quality), which might be interfering with RT reflections and potentially translucency. The quality of reflections looks like SSR, not RT, but there’s other settings to increase RT reflections quality when it’s that low…if it is RTR showing.

Translucent objects is not included in the PPV (post process volume). Don’t know if it was enabled before and got bad results, but if not, try enabling it. Same for Refraction in RT Translucency in PPV, enable it if haven’t tried already.

For the window meshes, what ‘Two-sided’ settings are enabled? There’s 3 total, one in the material, one in Lightmass settings for the mesh, and one for Shadowing in the details panel (not material editor, but in-editor).

Make windows not affect RT, might help

Fist of all thank you for replying.

Changing the RTGI to This does not make any difference. It was also set to Disabled and does not change the see-troughness of the windows.

The rrelections is set to RT and even if I change the reflections to SS instead of RT and uncheck/check the SSR Intensity/quality parts there is no difference besides less good quality reflections.

Are you are referring to the “Include Translucent Objects” under Ray tracing Reflections then no, this has been disabled. If I enable the setting it does not effect the windows. However, it does add quite a lot of bad reflections going on (see images below with darker areas on pint for example) and no effect on the windows.

Enabled:


Disabled:

I am referring to the imported mesh itself, not a setting in Unreal Engine.

Thanks, well this make it so that the windows look hidden instead.

Left is set to “true” “Visible in Ray Tracing” and on the right is set to “false” “Visible in Ray Tracing” on the mesh.

When “Include Translucent Objects” is enabled, it renders weird reflections in the car exterior. What are those things being reflected? It’s also reflecting the interior lit UI object which is below dashboard, but it’s in the exterior reflection…really strange. What external program do the meshes export from?

Yes you are right that the infotainment system is reflected oddly. I now realize that the parts that are reflected are parts that are behind other objects. So what you get is shadows going through objects that are behind other objects. For instance the glass on the geadlight and plastic foil form the other side of the car etc.

The material I am using are the material included in the AutomotiveMaterials package and the beach scene that Epic are giving out for free.

I tested to create a cube within UE and applied the same material. I get exactly the same result as as with the windows on the car.

From one side (one sided mesh on left, two sided mesh on right) and opposite side (one sided mesh on right, two sided mesh on left):

](filedata/fetch?id=1825227&d=1603451056)

This leaves me to conclude that either it is a material issue or settings issue…

I had a similar issue with a non-RT scene where objects behind a translucent object (pieces of a building frame behind a translucent sphere) were rendering a double that was a translucent shadow. The pieces of the building frame were simply metal supports around large window panes. However, there were other objects not getting rendered with a shadow double in the translucent sphere, so perhaps contrasting the materials for those non-problem ones to the problem ones could help discover the cause. I’m going to check in the project I was referencing.

Ok so I think I am starting to get somewhere. I created a new glass material and it is definitely working more as desired in terms of translucency.

Front: own mat on the left, automotive on the right.

](filedata/fetch?id=1826047&d=1603702344)

Backside, own mat on the right, automotive on the left.

](filedata/fetch?id=1826048&d=1603702344)

It looks complete. Are you able to post the material graph?

Well this was as simple as the following:


However, I did not feel it was as good as it needed to from an angle of a curved window mesh and I found the following:
https://www.unrealengine.com/en-US/t…-unreal-engine

I attached the white paper here also.

Here is the result:



Of course there are some stuff that still needs to be sorted with other things.

I think, there is a bug in 4.25 (have not tested it in 4.26), where currently the backside/inside of a mesh is calculated with an inversed opacity value, therefore pumping up the reflectivity to max at that area, where it should be almost fully transparent, and become basically opaque and highly reflective… while still getting overlaid with other refraction rays to create an illusion of it being fully transparent.
I had created a fresnel material, that can be driven by actual IOR values, and there it became quite obvious, that the backside behaves… really strange. And it couldn´t explained with total internal reflection, since i also tested it with a simple plane, that could not create this effect.

There is even more weird stuff going on, such as metal not being reflected in glass objects (only return black), while non metals get reflected as expected. Or that transparent objects create an overlay over metallic objects, as if they shine through (or at least, it´s clearly visible in shiny metals).

@Aemno Well done! Your solution works great. I have yet to get RT lighting / shadows to function correctly in a basic scene or for HDRI. The last attempt at RT translucency and reflections I did was fraught with issues, so I returned to non-RT projects for now.

@Suthriel I have observed similar issues with non-RT translucency where certain background objects get rendered into the translucent material in the form of translucent shadows (the 3D form of the objects is not there, only a simple shadow-type mask that is light-colored and is translucent because it overlays the color on the background). Plugging in (1, 1, 1) or (0, 0, 1) normals seems to get rid of it, or perhaps it distorts it to the point of it being removed from the view.

Yeah, because you actually turned of the raytracing reflections and force the material to use screen space reflections, which kinda contradicts using raytracing in the first place :cool: This should give a decent hint, that they know, something isn´t right with raytraced reflections in transparent materials. Not sure, how this affects the refractions.

There’s also limitations when the Lighting Mode is set to Forward Shading rather than Surface Translucency Volume (STV). Surface FS is based in the forward renderer, while STV isn’t. I don’t know exactly what the limitations are, but I think there’s at least 1 or 2 associated with translucency and fog. Fog is a translucent type of vfx, so it’s probably similar in terms of how/why forward rendering has limitations for both fog and translucency.

I have turned the SSR off and I get the same result. I wonder if the post processing is trumping the setting for the material in this case.