Results 1 to 4 of 4

Thread: how to render a model independently from the light source

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Location
    Los Angeles, CA, USA
    Posts
    101

    how to render a model independently from the light source

    Hi,

    I set up a tool that allows user to adjust the light amount from a light source. Any models' colors will turn darker or lighter if the light amount is changed. But for a particular model, I want it to be independent from the light source. No matter how dark the environment is, I always want the model to show its full, true colors as if it gains full light. What should I do when rendering this model? Your help is much appreciated.

    Tony

  2. #2
    Senior Member Frequent Contributor
    Join Date
    May 2005
    Location
    Prague, Czech Republic
    Posts
    913

    Re: how to render a model independently from the light source

    You might disable lighting (glDisable( GL_LIGHTING))when you draw that model or you can use texture environment (glTexEnv) which does not use vertex color (e.g. GL_REPLACE) when you draw that model.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,102

    Re: how to render a model independently from the light source

    Or just change the intensity of the light source to full before drawing this particular model, and changing it back afterwards...

    Depends on what effect you actually want (100% color intensity everywhere, or just 100% light intensity).

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2005
    Location
    Stockholm, Sweden
    Posts
    164

    Re: how to render a model independently from the light source

    You might also have the object contain the light-parameters that it "needs", allowing you to easily keep track of different light settings for different objects.

    Another option is to have a list of lights and each object have a pointer into this list (makes it easier if several objects use identical lighting params).

Similar Threads

  1. Size of the model: render time and light intensity
    By Pouya in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-02-2012, 09:15 AM
  2. move model and light but model gets 'out' of light
    By fokatar in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 05-08-2009, 04:50 AM
  3. light source
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-11-2003, 02:27 AM
  4. the position of light source
    By aguess in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-31-2003, 05:57 PM
  5. Area Light Source
    By ssaunders in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-13-2000, 08:22 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