Results 1 to 3 of 3

Thread: Lighting after textures

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Posts
    2

    Lighting after textures

    I have a small scene that I have added textures to some of the polygons. The scene renders correctly when textruing is disabled, but when texturing is enabled, all objects are at least half as bright.

    Any thoughts?

    Thanks

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2002
    Posts
    2

    Re: Lighting after textures

    Okay, figured this one out on my own. First problem, I didn't load the texture correctly. Second problem, if you don't color the object white, then it has the appearance of being dimly lit (with the wrong shading).

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Lighting after textures

    The reason it appeared dim when you didn't set the color to white is due to 2 reasons.

    1. The default setting for glTexEnv is GL_MODULATE, which causes the texture to combine with the current color (or material properties when lighting is enabled)

    2. The default color is a light gray. (Don't remember the exact values offhand.)

    You can either do as you did and set the color to white, or you could also use glTexEnvi and set the mode to GL_DECAL or GL_REPLACE.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. Using Lighting with Textures..
    By gokhan in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-07-2008, 12:14 AM
  2. Lighting textures
    By Tomy in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-16-2005, 03:27 AM
  3. Lighting textures
    By t3jem in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 04-01-2005, 04:38 PM
  4. Textures & Lighting
    By pmac in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-14-2004, 10:17 PM
  5. Lighting Textures?
    By Sephiroth in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 09-24-2002, 11:20 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