Book Image

Direct3D Rendering Cookbook

By : Justin Stenning, Justin Stenning
Book Image

Direct3D Rendering Cookbook

By: Justin Stenning, Justin Stenning

Overview of this book

Table of Contents (19 chapters)
Direct3D Rendering Cookbook
About the Author
About the Reviewers
Further Reading

Optimizing tessellation through back-face culling and dynamic Level-of-Detail

As we saw in the previous recipe, the number of generated triangles from tessellation can be quite high, and the most obvious optimization is to exclude any triangles that are facing away from the camera. This is called back-face culling. We will also look at how we may implement dynamic Level-of-Detail (LoD) by changing the tessellation levels, depending on whether the triangles are silhouetted or aligned roughly perpendicular to the camera view.

Getting ready

We will continue on from the point where we left off with the Refining meshes with Phong tessellation recipe.


All the code for implementing the back-face culling methods and dynamic LoD is included as comments within the HS_TrianglesConstant function in TessellateTri.hlsl for the Ch05_02TessellatedMesh project.

How to do it…

We will implement two methods of back-face culling, and then incorporate a reduction of the tessellation factor for non-silhouette faces...