Talk:Back-face culling

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Change[edit]

I've changed the following:

In computer graphics, back-face culling determines whether a polygon of a graphical object, within the field of view of the camera, is visible

to:

In computer graphics, back-face culling determines whether a polygon of a graphical object, is visible, depending on the position of the camera.

because this technique depends on the position of the camera, not on its field of view. If the back-facing polygon is outside the field of view, this technique would still cull. It just depends on the pipeline if it only culls back-facing polygons inside the field of view. - Simeon87 15:28, 12 November 2006 (UTC)[reply]

Equation[edit]

The equation Ax+By+Cz+D < 0 seems odd here in an article about backface culling. To determine of a face is visible i think it is better to use the Dot product between the view vector and the surface normal. Ax+By+Cz+D < 0 is used in view frustrum culling where it is used to see if every vertice lies within the frusrum or not. Isen't it better to just check if (C - Pv) dot Tn <= 0, where C are the camera position, pV is a vertice on the triangle and Tn is the triangle normal. If <= 0 the triangle shows its backface. Ondninja 19:55, 24 June 2007 (UTC) this is a dot product. normal=(A,B,C) distance=D and view vector=(x,y,z) —Preceding unsigned comment added by 84.16.123.194 (talk) 11:29, 15 January 2008 (UTC)[reply]

Culling faces for which dot((C - Pv), Tn) <= 0 is accurate. However, the associated article text has: "discarding all polygons where the dot product of their surface normal and the camera-to-polygon vector is negative." This is not accurate. (C - Pv) is the polygon-to-camera vector. Since it appears to be standard to work with the camera-to-polygon vector, I have changed the text to match the case where culling is done for all faces where dot((Pv - C), Tn) >= 0. More information here: http://gpwiki.org/index.php/Backface_culling. —Preceding unsigned comment added by 75.87.249.110 (talk) 18:13, 19 February 2011 (UTC)[reply]

Single Sided/Double Sided Polygons[edit]

I have removed this passage in my last edit

This technique only works with single-sided polygons, which are only visible from one side. Double-sided polygons are rendered from both sides, and thus have no back-face to cull.

Back-face culling is what causes polygons to be rendered from one side, likewise not performing back-face culling will cause polygons to be rendered from both sides. The statement is misleading.

Implementations[edit]

I have expanded slightly on the standard back-face culling method using surface normal. Some wording had to be changed, I'm referring to triangles as opposed to polygons, because it would be awkward to generalize to polygons, especially in symbolic notation or any actual implementation.

The real goal of this edit was to introduce another approach based on CCW check. Please understand, this is not a referenced work, and is mostly my own way of thinking about it, so it's open for scrutiny. However, it would be hard to find a better explanation anywhere else, most computer graphics books avoid this method, because no one understands it. I hope this brings some clarity to the subject. To demonstrate validity of both methods, I wrote an interactive demo, all source code for which is readily available.