Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: specular lighting

  1. #1
    Newbie Newbie
    Join Date
    Sep 2012
    Posts
    2

    specular lighting

    I am trying to project a specular(spot) light with some intensity close to red color. I haven`t added ambient or diffuse components to the light. The color of my spot is white. But however, when I add some diffuse component, the spot turns red(which is how i wanted it to appear). Can anyone explain why my spot has to have a diffuse component?
    Thanks

  2. #2
    Junior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011
    Posts
    214
    The diffuse color is the material property. If you shine with a white lamp on this material, all colors brighten. That is done by multiplying the RGB values with the same constant (usually depending on the angle to the normal). Ambient like is usually done by multiplying with a small constant.

    Specular light is a little different. It adds lights from the lamp, instead of multiplying. Depending on the strength of the lamp, it will override the material properties.

    Are you using legacy opengl? If so, consider using OpenGL 3, where you program the shaders yourself. When you do that, you have full control over lighting, and don't need to know how OpenGL does it.

  3. #3
    Newbie Newbie
    Join Date
    Sep 2012
    Posts
    2
    Thank you Kopelrativ!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •