# Software 3D graphic pipeline

## Recommended Posts

odile    122
I'm a little bit confused with how to implement 3d graphic pipeline should I do clipping before projection or after projection clip with -1 +1 plans? when I render the 2D triangle, how to compute the phong specular illumination? should I use the inverse projection transformation to get the coordinates in view space or compute it in projection space? could I get some links on detailed graphic card pipeline?

##### Share on other sites
Ashkan    451
Quote:
 I'm a little bit confused with how to implement 3d graphic pipelineshould I do clipping before projection or after projection clip with -1 +1 plans?

In a 3D pipeline, back-face elimination is an operation that compares the orientation of complete polygons with the view point or center of projection and removes those polygons that can not be seen. This operation is best carried out in view space. The sign of the dot product of the normal of each polygon and the view direction can be used to test for visibility.

Clipping on the other hand, is the process of removing non visible parts of a polygon (contrary to culling being a process that removes a polygon as a whole). So you can think of it as a generalized culling method. Clipping against the view volume can be carried out using polygon-plane intersection calculations (http://www.realtimerendering.com/int/), but the calculations involved are more efficiently carried out in homogeneous cllip space, right before perspective devision, because of the cuboid shape of the view volume.

So to sum it up do back-face culling in view space as illustrated above, transform your objects into homogeneous clip space by multiplying by projection matrix, cull objects outside of this volume and clip those intersecting it.

The best reference that I can point you to is "3D Computer Graphics" by Alan Watt. Here is a general schematic of the pipeline he describes in his book: http://www.video-animation.com/flash3d_008.shtml