I am continuing an older project that I started using Unity 2019.1.10f1 where HDRP was still experimental I believe. I could use the Layered Lit Tessellation shader on terrain in that version. In newer versions this doesn’t seem to work anymore.
Although I get the warning “Can’t use materials with shaders which need tangent geometry on terrain…” and is probably a heavy performance killer, it works nicely for the most part and despite partly unrealistic collision detection and grounding it achieves the graphical look that I want - getting additional detail on the terrain through layer heightmaps and elevation on top of the coarser terrain heightmap.
However I get some unwanted early frustum culling at the edges of the screen as you can see here:
I guess this is due to the fact that underlying terrain triangles would be outside the camera’s culling frustum if there was no tessellation that gave the triangle more “height”. I experimented with Camera.cullingMatrix, essentially trying to simply move the culling frustum some distance behind the actual viewing frustum. This did not work. Although I am sure that the culling frustum successfully moved, it was only possible to move it forward along the viewing direction, essentially having culled more and more on each side of the screen. Such missing triangles like in the screenshot remain however when moving it backward along the viewing direction (behind the camera).
I also tried messing around with the parametrization, amplitude, base and offset for the terrain layer tessellation. Although it reduces the problem with early culling it increases the problem with unrealistic collision detection and grounding where objects appear to float.
Does anybody know a solution to this problem? Why does the approach with the custom culling matrix does not work?