Game Development Reference
In-Depth Information
You should generally try to keep the far and near clip planes as close together
as possible, as these values are also used for calculating depth buffer values.
If the planes are too far apart, you can start to encounter render issues that are
sometimes called shimmering or Z-fighting . These can occur when there is not
enough resolution in the depth buffer values, which results in far distance polygons
rendering with jagged edges or worse still, randomly poke through each other as
they or the camera are moved. The following image shows another example of
Z-fighting that can occur when trying to render two overlapping co-planar polygons:
There are also four more clipping planes named left, right, top, and bottom. These
are planes which pass through the camera position and one of the left, right, top, or
bottom borders of the screen display area on the view plane. Together they form a
pyramid-shaped volume that emanates from the camera and defines the part of 3D
space that is visible and could therefore appear on screen.
The clipping planes are managed automatically for us by Marmalade, and they are
very useful as they allow us to quickly reject an entire model from being submitted
for rendering if it is completely off screen. The off-screen check is performed using a
bounding sphere for the model we are rendering, which is simply a sphere centered
at the model's pivot point that encompasses all the vertices of the model. The
bounding sphere can be quickly tested against all six clip planes and the model can
be skipped if the bounding sphere is completely outside the clipping volume.
 
Search WWH ::




Custom Search