[ad_1]
Z-culling (culls pixels which are behind already-drawn pixels within the Z-buffer) and back-face culling (culls triangles which are dealing with away from the digicam) are dealt with by the DepthStencilState and RasterizerState respectively. These are state objects.
They are additionally the names of properties the place you possibly can set these state objects on the GraphicsDevice (MSDN).
The default values are:
DepthStencilState.Default (MSDN) which is about as much as each learn and write from the depth buffer.
RasterizerState.CullCounterClockwise (MSDN) which is about as much as cull triangles the place the vertices are counter-clockwise.
There are different built-in states obtainable on the state objects, see the static members for every state object (MSDN: DepthStencilState, RasterizerState). Additionally you possibly can create your individual state objects that additional customise the behaviour.
XNA itself doesn’t present any built-in culling mechanisms, besides exposing these supplied by the graphics machine. These embrace Z-culling and backface-culling. You may additionally argue that the stencil buffer, scissor checks, and the viewport are additionally sorts of culling.
XNA does, nevertheless, present some helpful courses for including your individual, extra superior, object-level culling mechanisms. For instance BoundingFrustum offers intersection checks to let you decide what objects (often represented by a BoundingBox or BoundingSphere) are seen in your 3D digicam.
This query and reply present some helpful details about determine the place culling is suitable.
[ad_2]