I have a sun class (which will hopefully one day represent the sun) and it is the same as the Light Class in the rastertek tutorial. Currently it holds the diffuse direction and ambient values. During the initialization I set these values with this code:
mpSun->setAmbientColor( 0.005f, 0.005f, 0.005f, 1.0f );
mpSun->setDiffuseColor( 1.0f, 1.0f, 1.0f, 1.0f );
mpSun->setDirection( 0.0f, 0.0f, 0.75f );
and each frame when I render the terrain I make this call:
result = mpTerrain->render
( mpCore->getContext(),
world,
view,
proj,
mpSun->getAmbientColor(),
mpSun->getDiffuseColor(),
mpSun->getDirection()
);
Edited by kidman171, 19 October 2012 - 12:59 PM.