Terrain tesselation and dynamic shadows
While creating a terrain material I've ran into a performance issues with tessellation,namely with shadowcasting.
I am using quite large landscape and one dynamic light with far shadow cascade and having tessellation enabled on terrain material cripples performance. GPU profiler show roughly 5.0ms increased time for shadowed lights, ShadowDepthsFromOpaque. And that is only by just enabling tesselation in material parameters, having tessellation multiplier at 0. I can safely say that I did not experience this issue around UE 4.6 or so.
For the sake of consistency, I've reproduced the issue in a blank project.
Please note, that it happens only with landscape. If I replace terrain with a mesh of comparable density, I get no shadowcasting performance drop untill i start cranking tessellation multiplier way up.
Hi, after investigation i think the biggest issue, is that you're trying to tessellate a zone that is way too big, i.e the map provided is a 2kmx2km map, and about 1.5kmx1.5km is tessellated and shadowed..(ie in LOD0) which is quite costly even on high end graphic card.
I tried playing with LODs to see if performance could be improved and by changing the LODDistanceFactor from the landscape from 1 to 3-4 which you don't see much difference visually drastically reduce the cost of the shadow from ~8ms to 2ms.
We need to keep tessellation for the shadow pass to prevent issue with self shadowing.
Even in a case where you would have a really big landscape and you can see from up high a mountain down a valley, down the valley would be so far that the tessellation wont even be visible. Using foliage could also be a trick to help reduce the LODDistanceFactor even more as you wont see the floor with foliage on it anyway.
Hope this help!
Also why having Tessellation at 0 still cost more than having it at off, is really because of the Tessellation pipeline being used, as even if Tessellation is at 0, you can still provide a displacement map if you have a detailed enough terrain like the one provided in the example.
answered May 26 '17 at 02:01 PM
Thanks for the test project. I was able to confirm what you are reporting and have gone ahead and entered a bug report for the issue. You can track the issue following the link below on our new Public Issues Tracker.
Once the issue has been addressed by our engineers, the fix will be added to the release notes for fixed issues within an upcoming full engine or hotfix release.
Let me know if you have further questions or need additional assistance.
answered Aug 23 '16 at 03:16 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here