View Full Version : Lighting transparent Polys
Can transparent polygons be lit? I mean non textured just with a alpha colour.
I tryed it, and with glEnable(GL_LIGHTING); they were drawn solid.
What I am trying to do is get a specular effect on a transparent curved surface (made up of polys that is).
What about an object with a transparent texture?
If you want to assign a color to a polygon when lightning is on, you either have to pass the color with glMaterial, or enable color material which takes the current collor set with glColor and assign it to one of the polygon's color parameters.
Second suggestion is done like this:
This will cause the lighning engine to grab the current color and use it as diffuse material color for both front and back facing polygons.
You need to use these functions to set color, which includes the alpha value which you loose due to the lightning.
10-26-2000, 04:49 AM
I think that if you're using lights, you have to call glNormals in your rendering method. If you just want flat shading call it once per face with the face normal, but if you want s;ooth shading you'll have to call it for each vertex. And that mean that you have calculated them somewhere in your initializing method.
[This message has been edited by julien (edited 10-26-2000).]
Thanks Bob, I was doing the ColorMaterial thing already, but only GL_AMBIENT, adding DIFFUSE did the trick!
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.