Lights
Are light limited or something?
I was looking through gl.h when I noticed there were only 8 valid light names... is it possible to declare your own?
thanks in advance
MSDN says: GL_LIGHT_X (or whatever the macro was...) is equal to GL_LIGHT_1 + x ...
- fyhuang [ site ]
the GL Red Book says OGL 1.4 only handles 8 independant light sources. Im not sure but I think you might be able to declare more then that. Keep in mind though that for every light your performance is slowed down as the GPU has to process lighting for each light on each surfice. Or worse if your doing PPL
C_C(Enter witty/insightful/profound remark here...)
The minimum supported number of lights is 8. Some hardware implementation support more ( for instance the Quadtro series of cards supports around 30 I think ). Gaming/Home hardware however won't support more than 8.
If at first you don't succeed, redefine success.
couldnt you just define a couple of lights like their position, intensity, color and all of those other properties and not use the GL lights? then use a vertex shader and a pixel shader to light the objects?
Remember the limit of 8 lights means the amount of lights you can have affecting the particular set of verticies you are sending to OpenGL at a certain point. It does not mean the maximum amount of lights you can possibly have.
For example if you had a level with some lights in and you are rendering a certain object in that level. You can take the 8 lights closest to that object (or the 8 lights that will effect that object the most) set them up as GL_LIGHT_1 - GL_LIGHT_8 and render the object. Then when you want to render another object in that level you can take another set of 8 lights that have the greatest effect on that object and set them up as GL_LIGHT_1 - GL_LIGHT_8. Thus the two objects can be seen to be lit by different lights.
For example if you had a level with some lights in and you are rendering a certain object in that level. You can take the 8 lights closest to that object (or the 8 lights that will effect that object the most) set them up as GL_LIGHT_1 - GL_LIGHT_8 and render the object. Then when you want to render another object in that level you can take another set of 8 lights that have the greatest effect on that object and set them up as GL_LIGHT_1 - GL_LIGHT_8. Thus the two objects can be seen to be lit by different lights.
You could also create your own lighting system, this would fix the 8 lights limit.
_________________________A community of developers, artists and gamers.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement