Results 1 to 4 of 4

Thread: Problems with GL_LIGHTING

  1. #1
    Guest

    Problems with GL_LIGHTING

    WhenI enable the lighting, my object doesn t have any more colors. The problem lasts when I light the scene with white color (1,1,1) so it s not a problem of the lighting color.
    Could anyone please help me?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    154

    Re: Problems with GL_LIGHTING

    Your object is in grayscale?

    Did you define materials for your objects triangles too?..

  3. #3
    Member Contributor
    Join Date
    Apr 2002
    Location
    Spain
    Posts
    63

    Re: Problems with GL_LIGHTING

    Originally posted by aaarg:
    WhenI enable the lighting, my object doesn t have any more colors.
    When you enable lighting, the color information is "thrown away". The only color data that OpenGL uses then is the material properties (ambient, diffuse, specular colors). To get a correct shading, also don't forget to specify vertex's normals.



    [This message has been edited by Azdo (edited 05-16-2002).]

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Problems with GL_LIGHTING

    When you use lighting, the color is treated diffrently, maped like a material. You need to enable color under lighting, add this to your code before drawing anything: glEnable(GL_COLOR_MATERIAL);


    Originally posted by aaarg:
    WhenI enable the lighting, my object doesn t have any more colors. The problem lasts when I light the scene with white color (1,1,1) so it s not a problem of the lighting color.
    Could anyone please help me?

Similar Threads

  1. GL_Lighting and vertex colors
    By silikone in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-24-2017, 03:08 AM
  2. GL_LIGHTING
    By Myrmidon in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-27-2009, 06:58 PM
  3. GL_LIGHTING kills blending operations with glColor?
    By avocados in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-18-2005, 10:46 PM
  4. problem : gl_lighting mystery
    By HamsterofDeath in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 02-09-2003, 08:44 AM
  5. glDisable(GL_LIGHTING) kills framerate
    By zed in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-29-2000, 08: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