PDA

View Full Version : applying different materials to front and back



ngill
07-16-2000, 07:54 PM
GL_COLOR_MATERIAL is turned off...

I am having problems with applying different materials to front and back... if I only apply it to front... it goes ahead and applies it to the back... if I comment out the front part... it applies black to both front and back... any Ideas? is this even possible?

Relic
07-16-2000, 09:48 PM
It should work as desired with separate glMaterial calls for GL_FRONT and GL_BACK targets.
Quick check: Do you have two sided lighting enabled?

ngill
07-16-2000, 10:19 PM
Originally posted by Relic:
It should work as desired with separate glMaterial calls for GL_FRONT and GL_BACK targets.
Quick check: Do you have two sided lighting enabled?

That must be it http://www.opengl.org/discussion_boards/ubb/smile.gif, I didn't know I had to do that... lemme look it up in MSDN...

ahh here we go... after a couple of mins of searching I found this: GL_LIGHT_MODEL_TWO_SIDE

but not much was said for the second parameter, what should I put in there? They said "params is 0 (or 0.0), one-sided lighting is specified, and only the front material parameters are used in the lighting equation." but neglected to say about double sided value, oh well I guessed and put a 1.0 in there...

glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,1.0);

Thanks a lot again Relic! You couldn't have made it made it more exact http://www.opengl.org/discussion_boards/ubb/smile.gif