Tessellation of the terrain: I'm rendering my terrain with clip-maps frustum culling and tessellation shaders. Now to improve performance more, I want to use some tessellation shaders in a more efficient way. My aim is to achieve a pretty high (~100 FPS) frame rate with decent visual quality, so I'm gonna combine 3 tessellation factors, a tessellation map, view dependent (pixels per edge) tessellation, and silhouette tessellation.
My idea is a weighted average of them:
tessfac = tesscoeff*(w1*tessmapfactor+w2*silhtessfactor+w3*ppetessfactor)/(w1+w2+w3);
with the 3 factors varying between 0...1, and the tesscoeff could be an uniform too to adjust the levels. I have the map and the edge radius factors but...
Silhouettes:
How to find the silhouette patches on a mesh described with a simple y(x,z)
function? I'm using vertex-texture-fetch so I know the neighboring vertices/normals. Is it a problem if I'm using quad patches, not triangles, or it doesn't make it harder to find them?
(EDITED TO BACK-PATCH) Backpatch Culling: Another problem I've encountered is the back-face culling. As I've said, I'm using quad patches, so one may not lie on a plane. With triangles I would compare the normal to the eye direction, but on the quads I can't, or do not know how to do it.
Occlusion Culling: I'm rendering the terrain with geometry clip-maps, with the algorithm:
foreach(LOD)
foreach(quarter)
foreach(quad in quarter) //I mean x+z+, x-z+, x-z- and x+z- by quarters
quad.clipFrustum();
if(inFrustum) quad.render();
endloop
endloop
endloop
I have one single vertex buffer for a simple n*n
quad shaped mess. I have 4 index buffers for this mesh, one for each quadrant of this quad. For LOD=0
I render the center/bottom left quad, and for the other levels I only render the L-shaped mess with the other 3 (top,topleft,left) quadrants, scaled by pow(2,LOD)
. Then the whole mesh is scaled with a constant (gridscale).
Since this whole mesh is positioned every frame in front of the camera, the mesh is always rendered quadrant by quadrant from the view origin. Maybe it could be used for some culling like early-z or occlusion in the tessellation control shader?
I'm looking for some pointer on these because all I've found are some NVIDIA/AMD papers without much technical background. http://www.geeks3d.com/20101201/amd-graphics-blog-tessellation-for-all/ the link to the full article is broken too... (from this post: OpenGL Low-Level Performance Questions)