opengllightingterrainpixel-shading

realtime terrain lighting


What would be the best way to provide realtime lighting in an OpenGL terrain scene? The level of detail between of each quad will be generated dynamically as it is subdivided as it zooms in, so a pre-calculated light source will not work. I would like to simulate a sun on such a terrain. It doesn't have to be the best. It just has to look good enough. I am not familiar with shaders.


Solution

  • There's always Ye "Olde" Shadow Maps...e.

    Though to cut down on artifacts you'll probably want Perspective Shadow Maps (PSM), Light Space Perspective Shadow Maps (LiSPSM), or Trapezoidal Shadow Maps (TSM).