openGL polygon lighting
Howdy,
I am trying to introduce lighting into an openGL app. The shape that I am trying to light is a box. Some sides have a tecture mapped onto them. Others just have colors defined at the vertices which blend throughout the surface. However when I tenable lighting the colored surface all appear a flat red brown color while the tectured surface look fine. Anyone know what going on? I noticed that when lighting is off, if I call glColor3f with a blue color arguement before I texture a surface only the blue component of the texture appears. But if I do the same thing with lighting on the texture looks normal. Does glColor3f have no effect when lighting is on?
A.W.
I am trying to introduce lighting into an openGL app. The shape that I am trying to light is a box. Some sides have a tecture mapped onto them. Others just have colors defined at the vertices which blend throughout the surface. However when I tenable lighting the colored surface all appear a flat red brown color while the tectured surface look fine. Anyone know what going on? I noticed that when lighting is off, if I call glColor3f with a blue color arguement before I texture a surface only the blue component of the texture appears. But if I do the same thing with lighting on the texture looks normal. Does glColor3f have no effect when lighting is on?
A.W.
Quote:Originally posted by honkFactory
Howdy,
I am trying to introduce lighting into an openGL app. ... Does glColor3f have no effect when lighting is on?
A.W.
Nope, you need to deal with material properties when lighting is enabled; check out OpenGL Lighting FAQ for some useful info.
Colours work completely diferent when lighting is enabled. Check out...
http://www.sjbaker.org/steve/omniv/opengl_lighting.html
It's s pretty good tutotial.
http://www.sjbaker.org/steve/omniv/opengl_lighting.html
It's s pretty good tutotial.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Lighting and changing texture colors in OpenGL | agreendev | 2 | 6,109 |
Aug 13, 2010 03:47 PM Last Post: agreendev |
|
| Polygon budgets | Kerome | 1 | 2,381 |
Mar 7, 2010 04:55 AM Last Post: mikey |
|
| 2D Dynamic Lighting in OpenGL! Sort of... | metacollin | 22 | 15,359 |
Aug 19, 2009 01:48 AM Last Post: Madrayken |
|
| Getting the Normal for a polygon. | Jaden | 3 | 4,669 |
May 1, 2009 01:47 PM Last Post: Nosredna |
|
| Lighting a sphere with OpenGL lights (normals wrong?) | cecilkorik | 3 | 7,073 |
Dec 27, 2007 02:40 PM Last Post: _ibd_ |
|

