Results 1 to 6 of 6

Thread: More than eight light sources possible?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    9

    More than eight light sources possible?

    hi, I'm working on a openGL viewer with Qt. What I know by now is, that the final scenes loaded in that viewer need to consist of far more than eight lights.
    All my searching in the web, on forums and all book reading was leading to the same results. You can enable Light0 - Light7, and thats it.

    Am I wrong with the following thoughts?:
    Blender can cope with "n" Light souces, and as far as I know Blender is completely based on OpenGL. So there must be a possibility to implement that.

    I would be very thankful for every little piece of information you can give to that toppic.


  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: More than eight light sources possible?

    I don't know how Blender handles that, but it has 2 different 'lighted' viewing modes : the fastest only take 1 or 2 artificial lightsources, placed relative to current view.
    The better looking one can be very slow at times, it looks like the vertex lighting and colors is pre-calculated on cpu when it changes, and then drawn with no GL lighting at all. And specular lighting is off.

  3. #3
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: More than eight light sources possible?

    This can be done via shaders. You just have to pass light parameters through shader program custom uniforms not through the glsl built-ins.

    IMO, when you have a complex light set the better approach is deferred shading. This way you do not have to transform light position, etc, at each vertex. The lighting pass is done after the geometry is rasterized. Search "Deferred Shading" on Google forr more information.

  4. #4
    Member Contributor
    Join Date
    Jan 2007
    Posts
    89

    Re: More than eight light sources possible?

    * Consider replacing directional lights(infinte distance) with a environment map.

    * If you have no transparent objects you can do multipass rendering:
    - Render scene once with ambient light only
    - Set blend mode to additive
    - Render the scene again for each light source to sum up the light contribitions from each light source

    * In game engines, there is often a algorithm to use only the N(like 4) "most important" lights per object(based on distance etc).

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    258

    Re: More than eight light sources possible?

    you can render the model again and blend the result in the back buffer

    So if you needed 16 lights just render an extra pass.

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    9

    Re: More than eight light sources possible?

    Well, thanks for all your answers. Looks like I'll have to learn lot more about shaders and buffers to get this thing work at last.
    I'm still a dumb noob to OpenGL. Dissapointing...

    First I will finish my wavefront.obj Loader, and then tackle this problem, looking forward to post my advances soon

    And once more thanks

Similar Threads

  1. Multiple light sources interacting
    By leftblank in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-26-2012, 06:35 PM
  2. Area Light sources
    By nurbz in forum OpenGL: GLSL
    Replies: 1
    Last Post: 01-02-2006, 07:17 PM
  3. shadow mapping with 2 light sources
    By onegod in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-27-2004, 04:20 AM
  4. 8 Light Sources
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-21-2002, 01:37 AM
  5. multiple light sources
    By tanvi in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-17-2000, 08:11 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