Results 1 to 8 of 8

Thread: Lighting

  1. #1
    Guest

    Lighting

    .

  2. #2
    Guest

    Re: Lighting

    I guess something must be wrong with the OpenGL lighting facility that I got, shouldn't the screen turn pitchdark when I enable lightin, but without any lights?
    Besides, whenever I set up some lights I still don't get any changes, the scene remains the same es without enabling lighting. Anyone knows how come?

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: Lighting

    You need to send material properties for lighting to work, or enable color material. You also need to supply normals.

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

    Re: Lighting

    Is texturing Enabled? If so make sure you are using glTexEnvf(......,.....,GL_MODULATE);

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

    Re: Lighting

    Originally posted by harsman:
    You need to send material properties for lighting to work, or enable color material.
    You dont 'Need' to specify these, OpenGL does have defaults if these aren't specified. to get a light up and running (albeit one with the defaults) you just need to put :

    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);

    as long as your normals are specified at the vertices, there shouldnt be a problem. Try reducing it to the minimum lighting requirements and add stuff in.

    The only other thought is, have you speciied the ambient or emmisive properties at a high value such as 1? doing so will prevent lighting from having an effect..




    [This message has been edited by Rob The Bloke (edited 07-22-2001).]

  6. #6
    Guest

    Re: Lighting

    The GL_MODULTAE was the cause, I had specified GL_DECAL, thanks dude!

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Sep 2000
    Location
    SWEDEN
    Posts
    601

    Re: Lighting

    Well, ok, you don't _need_ to specify them, but things are really dark with the default values if you use say LIGHT1 instead of 0, so you might miss that your objects are lit. Especially if your display isn't gamma corrected. Hey, it happened to me when I was starting out, that's why I mentioend it. But my post was unclear, I should have worded it differently. Especially considering he said, his view _wasn't_ pitch black. I need to read stuff more carefully before I post...

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

    Re: Lighting

    Its only GL_LIGHT0 that has some default values, any other lights have 0 for all components. If GL_LIGHT1 was enabled, the only lighting you'd see would be the default scene ambient lighting. This has an ambient value of 0.3,0.3,0.3 I believe...... just a bit of helpful info

Similar Threads

  1. How to introduce Specular and Diffuse lighting into Bumped lighting
    By Liable in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-06-2004, 05:48 PM
  2. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  3. debug lighting vs release lighting
    By haust in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-30-2003, 10:43 AM
  4. lighting back facing triangles _without_ using two sided lighting
    By Nicolas Lelong in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-07-2003, 03:05 AM
  5. About lighting (not OpenGL lighting, but general lighting)
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2001, 09:10 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