Results 1 to 9 of 9

Thread: More than 7 lights?

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2001
    Posts
    3

    More than 7 lights?

    Is there a way around the limit of 7 (or light sources in OpenGL? Using Windows...

    Thx
    Drag0n
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: More than 7 lights?

    Get an implementation that supports more than 8 lights. If you can't find one, then download MESA, chanage the source and recompile.

    ... or, do the lighting calculations yourself.

  3. #3
    Member Contributor
    Join Date
    Feb 2001
    Location
    Slovakia
    Posts
    53

  4. #4
    Junior Member Newbie
    Join Date
    Oct 2001
    Posts
    19

    Re: More than 7 lights?

    my GL.h says this.

    #define GL_MAX_LIGHTS 0x0D31

    Does this mean allowed lights in system is
    3377?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,502

    Re: More than 7 lights?

    No, that is simply the value of the token GL_MAX_LIGHTS. You pass that to glGet to get the maximum number of lights.

  6. #6
    Junior Member Newbie
    Join Date
    Oct 2001
    Location
    Michigan
    Posts
    7

    Re: More than 7 lights?

    Cross-posting eh? Hehe, I just responded to the same question on Gamedev.net... http://www.gamedev.net/community/for...topic_id=62752
    -------------------------
    Trent (ShiningKnight)
    http://www.voxelsoft.com/sk

  7. #7
    Junior Member Newbie
    Join Date
    Oct 2001
    Posts
    3

    Re: More than 7 lights?

    Originally posted by ShiningKnight:
    Cross-posting eh? Hehe, I just responded to the same question on Gamedev.net... http://www.gamedev.net/community/for...topic_id=62752


    That might be because I asked the same questiong twice...

    Thx anyway...
    Drag0n
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."

  8. #8
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: More than 7 lights?

    You could probably blag it by drawing the scene a few times and using blending :

    Disable your eight lights

    Enable blending

    Enable another 8 lights

    Redraw.

    Disable blending

    swap buffers

    Lighting is an additive process.....

    alternatively look towards using light mapping .....

  9. #9
    Senior Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    764

    Re: More than 7 lights?

    You very seldom need more than 5-6 lights lighting a single surface => it pretty quikly gets totally white.

    Try using some per-object based dynamic ligtht source enabling/disabling, based on:

    A) distance to the light source
    B) light source position relative to the object and the viewer (if it's "behind" the object from a certain viewpoint, its effect will never be seen by the viewer)

    This way you will not only solve your problem, but you will most likely gain speed aswell.

    /Marcus

Similar Threads

  1. Speed of built in lights v.s. custom lights
    By STTrife in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-23-2013, 05:11 PM
  2. Can I use more than 8 lights?
    By AlexanderSK in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 09-29-2003, 03:02 AM
  3. lights and 3D
    By lara in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 11-11-2002, 07:11 AM
  4. Lights
    By PhireBat in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-07-2001, 06:13 PM
  5. Replies: 13
    Last Post: 11-29-2000, 02:19 PM

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