c++openglterrainshadows

Is there an easy way to get shadows in OpenGL?


I recently created some landscape code and added some diffuse lighting to the scene, however, to my disappointment, there are no shadows. I looked around the web for hours looking for ways to get shadows in OpenGL, however they all seemed terribly complicated; and very unique to their own demo programs.

Are there any simple ways to make shadows?


Solution

  • No. Rasterization is very bad at this (even recent AAA games have noticeable shadow artefacts), but everybody lives with it.

    Solutions include (approx. from easiest/poorest to best/hardest) :

    So the usual trick is to mix beautiful-but-static-only approaches with dynamic-but-not-that-good approaches. For instance, see my tutorials on lightmapping and shadowmapping.