View Full Version : About light!
10-11-2004, 11:08 PM
How many lights OpenGL can use? Only 8???
10-12-2004, 03: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, 03:59 PM
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.