Results 1 to 2 of 2

Thread: OpenGL Lighting...

  1. #1
    Member Contributor
    Join Date
    Dec 2001
    Raleigh, NC, USA

    OpenGL Lighting...

    Just curious, but how many lights does OpenGL allow? I have used several at ocne in my tiny test level and the dynamic lighting is GREAT (like on Unreal). Now I plan on allowing my game engine to progres to the state of an Unreal Engine clone, and for that I will need more than three lights at once. Is there a limit on OpenGL lights? If so, can I change it to a max value, say 512 or 1024? See some of the magic effects use lights also, so on a bigger level (say Nali Castle) I would need not only enough lights for all the torches, the sky, etc, but I would need at LEAST 128 free for magic spells and such that players and NPCs would be using on eachother.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2001

    Re: OpenGL Lighting...

    OpenGL implementations are required to support at least 8 lights. This usually will suffice.
    Since using multiple lights usually results in a dramatic decrease of performance, it is wise to use as few lights as possible while rendering your scenes.

    You can query your OpenGL implementation with glGetIntegerv( GL_MAX_LIGHTS), which will give the maximum number of simultaneously active lights.

    The trick is to reuse these available lights in such a way that only the relevant lights are enabled when drawing your primitives (for example, only activate the lights within a certain radius from the primitives).

    Lots of lighting tricks can be simulated by using lightmaps or other texture-based solutions to imitate highlights/shadows on objects.



Similar Threads

  1. How to introduce Specular and Diffuse lighting into Bumped lighting
    By Liable in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-06-2004, 05:48 PM
  2. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  3. lighting back facing triangles _without_ using two sided lighting
    By Nicolas Lelong in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-07-2003, 03:05 AM
  4. About lighting (not OpenGL lighting, but general lighting)
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2001, 09:10 AM
  5. OpenGL Lighting!
    By MrShane in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-13-2000, 01:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean