lighting techniques in openGl

Started by
0 comments, last by mikeman 13 years, 3 months ago
We want to implement light on our game...our game is like warcraft...how could we get started....how could we effective include light in our game...please help us to get started.
Advertisement
The easiest way is to take advantage of the builtin fixed function pipeline, that is with methods such as glEnable(GL_LIGHTING), glLightfv() and the rest. As the maximum amount of lights is usually 8 at once, one good way for moving objects is to calculate the nearest lights and for static world to divide it into cells. If you go into vertex lighting you might get better results.

Other techniques are lightmapping and per-pixel lighting, with the last mostly done with fragment shaders.

It all boils down to whether or not you want to start implementing shaders or use the fixed function, which I think in GL3.xxx is considered deprecated.

This topic is closed to new replies.

Advertisement