View Full Version : About light!
10-12-2004, 12:08 AM
How many lights OpenGL can use? Only 8???
10-12-2004, 04:45 AM
It's implementation dependent. The minimum requirement in the OpenGL specs and what most implementations support is 8.
You can query it at runtime with glGetIntegerv(GL_MAX_LIGHTS, &maxLights);
Some implementations support 16 or 24 lights, but it's pretty useless.
If you need more than 8 lights, you can either take a virtual lights approach and only use the 8 lights nearest to the object you're going to render, or use a multipass approach with blending, or put the lighting environment in a cubemap and and use texturing to put as many "lights" onto your object as you want in one pass.
10-12-2004, 04:59 PM
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.