Path Tracing Glass Material Black artifacts

Hi all,
I´m here regarding an issue with glass material in Path Tracing.

Let me explain my goal first so that you can better understand the issue. I am trying to prepare a Metahuman to be rendered in Path Tracing. Most of it works now out of the box, but the eyes change quite a lot from one renderer to another. The main feature that can be improved upon is the watery effect on the eye. While realtime metahuman has it, it´s almost non visible in path tracing and it does not use any refraction.
Real Time


Path Tracing

So my task was simple, just apply a water material to the geometry MH provides for the tearline in the eye. This is where I encountered some ugly artifacts.
I simplified the textures to make the error clear. You can see the glass/water geometry, the eye and the black areas.


At first I thought they were intersecting geometries. But I realized it shouldn´t be doing that anyway. It seems like there is some kind of milimetric occlusion going on.
Let me show you what is happening in here if we intersect a glass cube into the floor.
bros2
You can see that in the last moment, the glass turns black. It goes into that small distance that turns the glass back like in the eye. The distance seems to be around 0,004 UE units and I can´t find a way of making it just be 0.
More examples with a normal and a glass sphere


the more parallel the polygons are, the most visible the gap.

This is a big problem to create realistic eyes in Path tracing, the way we do in other offline renderers.

My glass shader is the most basic at the moment, in case you were wondering.


I tried touching almost any checkbox I could find, even the ones that didn´t make sense but couldn’t get rid of the effect. I tried light bounces, disabling occlusions, changing IOR values… Nothing changes this.


This picture shows the same intersection, this time the material does not have refraction, instead it’s 0,5 opaque. You can see there is still an artifact, but it’s not black.

Which means this must be happening all the time but we don´t notice it because we mostly work with opaque materials.
It seems that there is some kind of occlussion or shadow bias size that affects this that does not let the light go through really small gaps between geometries. Does anyone know if there is a fix or a command for this?
This is all 5.4, by the way.
Thanks!

1 Like

Currently having the exact same issue…

Just looking at the artifact type alone, it seems like a ray bias or shadow terminator problem? You can probably change ray offset settings in the CVars somewhere, but it looks like the demo sphere you’re showing off is very faceted, do you get the problem on a higher poly mesh that can better support the rounding?

(post deleted by author)

Hi, yes the sphere is quite faceted. A higher polycount would indeed result in less noticable areas, but I feel like that´s just a patch fix and the problem would still persist. Specially since I’m planing on using it on Metahuman Topology which is high, but not as much as a cinematic, subdivided model.

I too think this looks like some kind of bias problem. To me it feels a bit like the light doesn’t get into that little space. And it is size dependant, for example, if I multiply x10, it´s less noticeable. So it´s not an issue of camera being closer or further, it is really something that happens phisically at that size. But I don’t know where I can find a command to reduce that gap distance. Vray has Shadow Bias, for example, but I can’t find anything similar for path tracing.

If that’s true, then that really sounds like the shadow terminator problem. I tried replicating your issues in my instance with a standard glass material and I haven’t had any of the problems you have, which is interesting to me. I am working in 5.5 however, which makes me wonder if your problems might be fixed if you migrate? I’d at least spin up a 5.5 instance to check it out, given how much work Epic put into bringing the PT up to parity with raster in this version.

Yeah I believe I will have to try that… Thanks for the suggestion. I just recently moved all my projects to 5.4 and erased 5.3 to save some memory. I think I can’t avoid 5.5 anymore though, specially since it is supposed to have improved upon Path Tracing. I´ll update and post about the results.

It’s interesting that you couldn’t replicate it. Did you try getting really close?

I’m afraid the problem persists in version 5.5 too…

OOC, did you adjust the near clip plane values in your project settings?

So, it’s not a material issue, the geometry is topologically valid, version # makes no difference…this is interesting.

Hi! I set my near clip plane to 0. But that should only affect the clipping from the “camera” in geometries, right?
Yeah it’s interesting… I can recreate it but can’t see where to fix it. I’ve searched online a lot and read through Path tracing documentation but I don’t see anything that applies here

I’d try resetting your clip plane and see what happens. Sometimes ray biases can be influenced by your clip plane in magic number scenarios, and in general any change from standard behavior carries risks. Would you be willing to share a demo project?