Backface Culling

Backface culling removes triangles that do not face the camera. This reduces the number of fragments processed by the GPU. This has the most impact on performance when used on large primitives with the 3D window maximized.

Generally, backface culling should only be applied to closed, opaque objects. For example, when backface culling is used on an opaque cube composed of 12 triangles, the GPU only has to process fragments for up to 6 triangles.

Backface culling can also be applied to meshes on the surface. When the triangles become back facing, they can be culled since they are occluded by the central body. If the mesh is at altitude, backculling will cause visible triangles to disappear as shown below.

Backface culling is enabled by setting the triangle mesh's CullFace property to CullFace.Back as shown below.

[C#] Copy Code
mesh.CullFace = AgEStkGraphicsCullFace.eStkGraphicsECullFaceBack;

Backface culling does not always provide gains. For example, if 5 degree extents are used instead of 30 degree extents, no performance is gained from turning on backface culling and keeping the same view. Backface culling is most effective on large primitives. Regardless, turning on backface culling is unlikely to hurt performance. Furthermore, when zoomed in close, even a small primitive can have far fewer fragments processed with backface culling than without it.

STK 11.2.1 Programming Interface