dtCore::SunlightShader Class Reference

A light scattering pixel shader for use with dtCore::Environment. More...

#include <sunlightshader.h>

List of all members.

Public Member Functions

 SunlightShader ()
 ~SunlightShader ()
void Update (const osg::Vec2 &sunDir, const osg::Vec3 &eyeXYZ, float turbidity, float energy, float molecules)
 Update the shader with new values.
osg::VertexProgram * GetLightScatterinVP ()
osg::FragmentProgram * GetTerrainFP ()


Detailed Description

A light scattering pixel shader for use with dtCore::Environment.

This shader is built into the Environment and is used by setting the Environment::FogMode to ADV.


Constructor & Destructor Documentation

dtCore::SunlightShader::SunlightShader (  ) 

< Magic number

dtCore::SunlightShader::~SunlightShader (  ) 


Member Function Documentation

void dtCore::SunlightShader::Update ( const osg::Vec2 &  sunDir,
const osg::Vec3 &  eyeXYZ,
float  turbidity,
float  energy,
float  molecules 
)

Update the shader with new values.

Parameters:
sunDir : The az/el of the sun in Degrees. sunDir[0] = az (0=north, 180=south) sunDir[1] = el (90=horizon, 0=zenith)
eyeXYZ : The Camera position (meters)
turbidity : The quality of the air (1.0 seems about right)
energy : The amount of energy passed to the atmosphere (10.0 is about right)
molecules,: The number of molecules per unit volume (0 = fully opaque, 2.545e25 looks about right)

osg::VertexProgram* dtCore::SunlightShader::GetLightScatterinVP (  )  [inline]

osg::FragmentProgram* dtCore::SunlightShader::GetTerrainFP (  )  [inline]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008