Hi, I’m struggling a bit with lighting artifacts on a probe-lit terrain.
Scene is a heightmapped terrain with a small house. I set up two probe volumes, both local, one sized to the terrain with widely-spaced probes and the other sized to the house with closer spacing. What I’m seeing is that the lighting from the probes is very patchy around the house. This scene is in HDRP with a noontime sun, physically-based sky, no sky occlusion and showing indirect diffuse lighting only:
I tried a couple of options to mitigate this, but they have drawbacks I’d like to avoid:
Crank up the normal bias - only was effective when it was maxed out, which causes lighting artifacts in other parts of the scene. I could do this with a volume, but if I understand correctly it would only take effect when the camera is inside the volume so would still look poor from e.g. inside the house looking out
Set the terrain to not contribute GI - this eliminated the patches, but I think would cause poor lighting when/where the terrain should be casting shadows
Probe adjustment volume to invalidate small areas of probes - worked, mostly, but was very fussy and time-consuming and I think not a sustainable approach for busier scenes
I think if the terrain had some “depth” that could be used to invalidate probes just below the surface, like the APV system figures out for mesh objects, it would be ideal but not sure if there’s any way to fake that out or get a similar effect. I also tried adding a rendering layer for the terrain but didn’t see any difference. Would love to hear if anyone else has run into this & how you addressed it. Thanks!
Using a probe adjustment volume to offset the probe calculation there might also help.
What I think might be happening is it’s too deep in the ground making it darker, having it offset more should help. But you need to do a volume specifically for that area then making sure the orientation is correct (there is a visible arrow).
Nice suggestion. That does work and is less fiddly than using volumes to invalidate small groups of probes; I hadn’t noticed the offset adjustment mode. I do see the artifact happening a lot around the terrain so it would be a little painstaking to try and clean everything up & preferably the virtual offset / invalidation from backface hits would cover more of these. I agree that “deep in the ground” looks like the issue but it also will sample from probes like this one that are juuuust barely below the surface (shown at debug size 0.3), regardless of the validity threshold or any other settings I could find
Great pointer, I’ll check it out. Sounds like a nice practical showcase of APV setup.
For this issue - I’m going to chalk it up to something funky going on with the terrain, although I couldn’t say what. Maybe texture/splat related, although I don’t think I was doing anything particularly exotic. When I create a new terrain with the same heightmap, the probes behave as expected and the fallback settings that @Pema-Malling mentioned have the expected effect; dilation also helped with a few areas. And now everything looks good without needing adjustment volumes.
What I really wanted to test was scenario blending for day/night, so for now I’m using the duplicate terrain for baking w/contribute GI ticked on, then I switch terrains and then the original one picks up the probe-based lighting. Later I’ll play around with a clean setup and see if I can repro with the same heightmap, textures & splats
Aha! I am pretty sure this has to do with terrain holes.
In my original terrain, I created a hole around the house’s foundation, where the basement goes below the ground.
In the second terrain I made from the same height map - no hole, and probes looked good. Except for the basement, which I forgot about… and as soon as I remade the hole, baking resulted in no probes being invalidated due to the terrain.
Probes shown in validity mode - terrain with no holes
Well - I was still on 6.000.0.21f1, one of the later U6 pre-release versions. Figured I’d grab the latest LTS and repro with a stripped-down scene to make it easier to package up, but I didn’t see the behavior anymore, and it went away in my main scene after upgrading that to .27f1
If you still want to look, let me know - I have a different smaller scene on .21f1 that exhibited the behavior that I haven’t upgraded, but I’m inclined to say whatever was causing this got fixed along the way. Definitely learned a bunch about debugging light and probes from it so I’m kind of glad I ran into it…