Backface Culling?

Blitz3D Forums/Blitz3D Programming/Backface Culling?

WillKoh(Posted 2004) [#1]
What is the backface culling flag you can set with EntityFX?


Zethrax(Posted 2004) [#2]
Check out Surfaces > AddTriangle in the Blitz3D docs for an explanation.


poopla(Posted 2004) [#3]
Every triangle has a direction that it faces. This is based off the order they were created, and derived by the cross product of the vectors between them. So, if your behind a triangle, your looking at the back of it. Backface culling keeps triangles that your looking at the back of from being drawn. Turning it off skips this process.

Usually you want it on, except for specific cases.


sswift(Posted 2004) [#4]
Imagine you create a sphere. If you go inside that sphere, and backface culling is enabled, which it normally is, then you will see the outside world. You cannot see the triangles from the "back" side.

You want backface culling on, because it reduces overdraw. IE, drawing stuff over the same pixel multiple times. Overdraw eats fill rate. Fill rate is how many pixels you can draw per second.

Incidentally, if you disable backface culling, the textures on the inside will be the same as the outside, but backwards, and all the lighting will be inverted, so what you think should be lit won't be, and vice versa. You'll see the light that falls on the outside of the sphere, not the inside.


Rob Farley(Posted 2004) [#5]
16