View Full Version : specular lighting
09-07-2012, 12:31 AM
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?
09-07-2012, 12:47 AM
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 (http://www.opengl.org/wiki/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.
09-08-2012, 01:11 AM
Thank you Kopelrativ!
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.