PDA

View Full Version : The Dark Side Of The QUAD



NOAH IV
08-27-2003, 05:12 AM
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? http://www.opengl.org/discussion_boards/ubb/smile.gif

errno
08-27-2003, 05:57 AM
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).

zeckensack
08-27-2003, 07:36 AM
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.

Clayton
08-28-2003, 11:23 AM
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).]

Bob
08-28-2003, 11:35 AM
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.