OpenGL lighting


OpenGL implementation of different light casters and specular maps that follow Phong lighting model


Three Part Implementation

First part demostrates how basic Phong lighting model works, including combination of ambient, diffuse and specular lighting.

Phong lighting model

Second part demonstrates how specular maps are implemented in order to achieve different specular reflections depending on the material. In it's most basic concept, we are using one texture to for visual representation, while using the other texture to perform our calculations on.
This way, specular map for wooden part in the following example, can be just a black box, meaning it won't reflect anything, because black is represented as a 0 vector, meaning all of our vector multiplications will be equal to 0.
On the other hand, metalic parts in the following example, can have brighter values in certain areas, meaning our vector multiplications will actually return a brighter value in some cases, visually represented as some hilights.

Specular map demostration

Third part demonstrates various light caster implementation, including:

All parts of the project combined.


Technologies used