PDA

View Full Version : lighting and reflection!



dvwood
01-08-2009, 02:32 PM
What of these is true for lighting and reflection in OpenGL ?
A specular reflection depends on the viewer/camera position
B Gouraud shading (Smooth shading) depends on the face normal of the rendered pixel
C ambient lighting and reflection can approximate light coming from all directions
D diffuse reflection depends on the viewer/camera position
E each rendered pixel of a surface has its own normal
F when the camera looks into a light source, the light appears as a non-shaded sphere

I would say the following are correct:
C - its like a plane of vectors, right? Or am i talking about Directional lights??
E - true... right?
F - not sure about this one...

Can someone confirm?

Help is much appreciated!

remdul
01-08-2009, 02:55 PM
None of these questions can be answered with a definitive yes or no, without knowing the context, and what exactly is meant with terms like 'reflection' (specular reflection? light reflection? reflection as in cubemaps?), 'ambient lighting' (fixed pipeline ambient or ambient in genral?) and 'diffuse reflection' (reflection as in scattered reflection rays, or reflection of diffuse light off a surface?).

dletozeun
01-08-2009, 02:59 PM
A) true

B) Gouraud shading rely on vertex normals. If you use face normals you compute flat shading.

C) "Ambient lighting" not sure the term is correct here. When we want to refer to "light coming from all directions to a surface point" we talk about "Global illumination. There are many techniques that attempt to synthesize global illumination. Most of them rely on ray-tracing, radiosity. I am not well informed about this field in real-time, I heard about the use of spherical harmonics.
Reflections, through cube maps for example, may help to add realism to lighting.

D) Wrong. The diffuse reflection considers a light beam that is reflected on a surface in all directions with an intensity that depends on material properties.

E) True, (point on surface is better than "pixel on surface). You can obtain a surface point normal parametrically of interpolating normals from vertices that form the face.

F) Don't understand.

EDIT:

By "reflection", I assume you are talking about "reflectance".

Rosario Leonardi
01-08-2009, 06:13 PM
F - absolutely false. A lot of DCC program like 3DsMax or Maya render light with an icon or a ball to let you "see" the position of the light but it's not an openGL feature.

In real life there is no such thing like "ambient light" it's only an approximation. Very few engine still use ambient light to approximate the constant ambient term of the light.
For example Half-life 2 use a 1x1 cubemap, more modern engine like Unreal tournament or Halo 3 use spherical harmonics.

remdul is right, a lot of reply given by dletozeun are 99% right, but for example diffuse light can vary with the camera/light position if you use more complex lighting model like BRDF. The fact that diffusive light is constant in every direction it's only an approximation that in future will be used less and less.

dletozeun
01-09-2009, 04:20 AM
but for example diffuse light can vary with the camera/light position if you use more complex lighting model like BRDF


That is true, it is a delicate subject to talk about. When you talk about BRDF, the specular and diffuse reflectance are combined. dvwood, was only talking about the diffuse reflectance and this one does not depend on the eye position, unlike specular reflectance. And I did not say that the diffuse reflectance is constant in all directions (lambertian surface approximation), only that, this one has "an intensity that depends on material properties" (BRDF model).

dvwood
01-09-2009, 06:38 AM
Thank you so much guys, this information is gold!

satan
01-09-2009, 06:54 AM
I don't want to be evil (well actually I am quite evil). But this looks alot like some kind of homework (as most of dvwood questions do). In which case I am quite sure that when talking about OpenGL in general the questions are talking about the fixed function pipeline. The questions are definitivly n00b stuff, just badly formulated as is pretty standard for universities.
So I think E) is false. As there are only vertex normals and not per fragment ones. dletozeun is correct in how to compute them, but OpenGL itself knows nothing about them (remember we are talking fixed function).

dvwood
01-09-2009, 07:06 AM
Yes its actually for a test. I am trying my best to read and answer these questions my self, but as you can all see, i am a big fat n00b, trying to learn from the best. I didnt know about spherical harmonics before, cause we never had it, but it is quite interesting and it made me look it up.... so thank you for the free knowledge ;o)