so you might as well normalize the normal only once, rather than every frame. While normalizing the normal is not needed in backface culling, it will be in shading, etc. It is recommended that you precalculate polygon normals, of course, because it can save you calculating it each frame. This is done as shown in my vector tutorial. First you must calculate the normal of the polygon you wish to test. Okay, now that I've hopefully persuaded your of the importance of backface culling, let's look at how it works. On average, it can be said that half of the polygons in a polyhedron are facing backwards, so, with this simple technique, you can remove 50% of the work load from the rest of your routines! This is a very simple requirement for such a powerful device. Which ever you choose will reflect whether you cull objects with a dot product greater than 0 or less than (more on this later). When defining polygons for an object, they must be defined in counter-clockwise (or clockwise) order. In backface culling the sign of the dot product is enough to tell us which polygons are visible, and which are not. It's sign is also important because it alone can tell a rough estimate of the angle. I will now further expand upon this and introduce this system which is used to reject non-visable polygons.Īs I said in my vector tutorial, the dot product can be used to find the measure of the angle between two vectors. In my previous chapter I introduced vectors and described some of their uses.
0 Comments
Leave a Reply. |