Download

Procedural Foliage Volume Shadow LOD Issues: Solved

So I noticed that when the Spruce tree’s from the ‘PN Interactive Spruce Forest’ pack are loaded into a Procedural Foliage Volume and I move away from the ‘Full’ Trees the shadow visibly changes.

In the picture you’ll notice that the trees to the right of the highlighted one have different shadows then the one’s directly behind them. The trees in the foreground were placed in by hand and the ones directly behind them were placed using the Procedural Foliage Volume. If I move closer then those trees will have the same shadows as the ones placed manually. It shouldn’t be doing that though. It’s hard to tell in the picture, but the tops of those trees directly behind them are brightly lit where there should be shadows and it appears that way for every LOD except the first one.

So I was using the GPU Lightmass on this scene, I had to enable ray tracing. I disabled everything I was told to in the video but apparently this was left out

r.RayTracing.Geometry.InstancedStaticMeshes.Culling 0

The Procedural Foliage tool uses Instanced Static Meshes and the ray tracing was screwing up my shadows.

I wanted to add that the above isn’t really a permanent fix, it will shoot your draw calls through the roof. I’m not actually sure what the best fix for this is outside of disabling ray tracing all together…which is what I ended up doing. My draw call more then doubled when I disabled that. If I try to increase the cull radius…it does the same thing. Outside of not using the Procedural Foliage Volume with Ray Tracing I don’t know what the best approach to this would be other then maybe making them really small.

So the above isn’t the proper way to disable this

r.RayTracing.ForceAllRayTracingEffects 0

Seems to be what I was looking for. I think that may have been mentioned in the video and I forgot to do it I don’t remember honestly. Either way RayTracing does not like instanced meshes and when you turn it off the shadows won’t look nearly as good.

Thought I would add that the effect only happens when the instanced mesh is spread out of a large distance. You could probably use them in small tightly packed clusters but it’s not ideal for a forest, I honestly don’t think there is a way around it. Instanced foliage just doesn’t seem to work well with RayTracing.