Question

While experimenting with lighting in OpenGL (using the LWJGL) I found that a positional light illuminates parts of a model which actually should be in the shadow. Here is an example: Falsely illuminated part

Am I doing something wrong or is this just the way OpenGL's positional lights work?

Was it helpful?

Solution

Shadow mapping is not a built-in feature of OpenGL. In the normal case, the visibility of specular lighting only considers the angle of the surface relative to the light source and the camera. Determining whether or not there is something between the light source and a surface requires greater sophistication and additional computation.

OTHER TIPS

You doing it right and result is as expected.

By introducing directional light you do not cast any shadows. You just darkening pixels where normals are faced out of light source.

Tail just don't know about existence of rabbit. To darken a tail you need to implement shadow mapping (basically, you need to know if tail's geometry is visible from a point of view of the light source, or it is occluded by rabbit).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top