Graphics Reference
In-Depth Information
return result; // culled, so no further processing
}
// end: backface culling
...SNIP rest of function excluded from listing
2.
Running the project now, we see a very similar result. However, if you look closely at the
two renders, the culling based on the face normal will sometimes remove a partially
visible triangle whereas using the vertex normal does not (circled in the following
screenshot). This is especially noticeable in low-poly models, where a larger angle
threshold is necessary. By increasing the angle threshold, we can address the issue.
Back-face culling (left using the face normal and right by checking all vertex normals)
Dynamic Level-of-Detail (LoD) near silhouettes
We will now take advantage of Phong tessellation to improve contours and silhouettes,
while minimizing the number of triangles generated elsewhere. We do this by reducing the
tessellation factor on surfaces that are facing more directly to the camera.
1.
First, implement back-face culling, as described earlier, using vertex normals.
2.
If the dot product is larger than 0.125, we will set a multiplier variable to reduce the
inside tessellation factor by 0.25 of the full tessellation factor. Otherwise, we will
leave the insideMultiplier value as 1.0f :
float insideMultiplier = 0.25f;
...
result.InsideTessFactor = roundedInsideTessFactor *
insideMultiplier;
 
Search WWH ::




Custom Search