Clipping (computer Graphics) - Non-triviality

Non-triviality

Clipping is non-trivial, especially for 3D animations: if the objects are built up of polygons, a routine is needed that determines for each polygon whether it is visible within the viewport (i.e. the part of the 3D "world" displayed) or cut off the borders. Special care is needed for the case of polygons intersected by the viewport border as their shape has to be adjusted.

While the term "clipping" is generally used to mean avoiding the drawing of things outside the camera's field of view, a related technique is occlusion culling, in which polygons within the field of view are not drawn if they would be occluded by other polygons. For example, there is no need to render the polygons composing the side of a building facing away from the observer; they are all completely occluded by the front of the building. Hence the software can save significant rendering time by doing a back-face culling pass before deciding which polygons to draw.

The clipping, back-face and occlusion culling optimizations both present interesting problems in scenes with a reflective surface visible. For example, problems would ensue if the 3D scene contained a mirror that showed the reflection of a building that had been clipped because the building was behind the camera. To deal with 'true' reflective surfaces (as opposed to the 'fake' reflections of environment maps), the clipper might do a clipping and rendering pass from the point of view of the mirror, and then the normal clipping pass for the camera.

Read more about this topic:  Clipping (computer Graphics)