APV and Shadow Issues

Hey,

we moved from lightmaps to adaptive probe volumes (apv’s) with Unity 6. The main reason is we need to impelement day-night cycle to the game which will cause big performance issues with realtime lightning. Sadly we had issues with terrain and APV. Terrain trees and vegetation causes square shadows on different places. Disabling Draw tree and detail objects fixes all the issues.


It looks like these shadows are cast mainly by the sun? Presumably a directional light. Try setting that light to Mixed instead of Baked and re-baking.

Directional light is the main source of lightning. We changed it to mixed then all of the artifacts fixed but as expected fps dropped a lot. After experimenting with many thing we found that a some tree on the terrain causes the issue. Even though they far away from the problematic areas.

It took us many days to find it. Removed that trees from the terrain gives better results but still not acceptable.

But anyway it seems like the problem totally related with environment tree and grass when using APV, and no idea how to fix it.

I will try change the foliage asset on next iteration.

It honestly just looks like insufficient probe density to capture such a hard shadow to me. It’s like trying to use a super low resolution lightmap on the terrain, you’d get similar blocky looking shadows.

If I’m right, the reason it goes away when you switch to mixed lighting is because the trees will then cast realtime shadows instead of baked ones. And then the only real ways to ‘fix’ this is to increase the probe density (min probe spacing), or to use a different approach for lighting the terrain, such as a lightmap (you can freely mix APV and lightmaps).

I don’t think baked shadows are ever viable anyway. Should try cached shadows instead

On relatively high resolution lightmaps they can look quite good. For probe-based techniques, it’s more tricky, since you need a very high density to get something decent looking.

However, using Mixed Lights, you can bake shadows into APV, and use Distance Shadowmask mode, such that the baked shadows are only sampled for distant objects, where the difference is less noticeable. I think that can work pretty well.

Cached shadowmaps are a pretty nice solution too, if you have access to them. Currently HDRP only.