The Dark Side Of The QUAD

Hi,

I’m wandering how do you do when you want to draw a quad that has a texture on one side and looks black from the other side…

Any ideas, other than draw another black quad?

it can be done using lighting.
set a white front material, a black back material on the quad, and set the texenv to GL_MODULATE.

it doesn’t work for other color (black modulated by a texture is black but yellow modulated by a texture is not yellow).

Use culling.
glCullFace(GL_BACK);
glEnable(GL_CULL_FACE);

Only the front of the quad will show.

Two-sided lighting should work too, but is a much bigger burden on the hardware.

However, if you wish for the back of the quad to appear BLACK you cannot use Culling as the cull will simply not render the face, not draw it as Black. Two sided lighting however, will.

[This message has been edited by Clayton (edited 08-28-2003).]

It is possible to do that with back face culling, but you have to draw your object twice; once for front and once for back faces.