PDA

View Full Version : specular lighting and shininess



kalkas
07-28-2011, 03:39 PM
hi

here's my problem.
i recently enabled lighting in my project. i don't use shader.
just the default light of opengl.
i'm given to understand from some tutorials that the shininess
atribute of an object's material is proportional to the shininess i will see in my object. i notice that in reality
this is the opposite. when i have [1.0, 1.0, 1.0] for specular
color and [0.0] for shininess is bright white everywhere that getting light.
with shininess >100.0 is more normal,but, from some angles
some faces of the cube are becoming white again. cube's
ambient and diffuse color is [0.8, 0.8, 0.8] and
my light properties:
ambient [0.2, 0.2, 0.2]
diffuse [0.8, 0.8, 0.8]
specular[0.5, 0.5, 0.5]

what it is that i'm not understanding?
what bugs me the most is the shininess atribute.
the bigger the number is, the smaller the shiny effect is.
am i wrong?

thanks

kowal
07-29-2011, 05:53 AM
Look here:
link (http://http://wiki.gamedev.net/index.php/D3DBook:(Lighting)_Blinn-Phong)

It discusses Blinn-Phong model of per pixel lighting in HLSL (D3D), but gives good understanding of lighting.
(Lighting in OpenGL works the same way, but In fixed-function (without shaders) is calculated per vertex and interpolated,
it also uses different equation: http://en.wikipedia.org/wiki/Lambertian_reflectance)