10 #ifndef SLLIGHTDIRECT_H
11 #define SLLIGHTDIRECT_H
73 float clipFar = 20.0f,
78 int numCascades = 4)
override;
Declares a color look up table functionality.
SLVec2< SLfloat > SLVec2f
Toplevel holder of the assets meshes, materials, textures and shaders.
Active or visible camera node class.
SLLightDirect class for a directional light source.
SLbool _doSunPowerAdaptation
Flag for sun power scaling.
~SLLightDirect() override
void sunLightPowerMin(SLfloat minPower)
SLCol4f ambient() override
Returns the product of the ambient light color and the ambient light power.
void doCascadedShadows(bool b)
SLVec4f positionWS() const override
SLLightDirect(SLAssetManager *assetMgr, SLScene *s, SLfloat arrowLength=0.5f, SLbool hasMesh=true, SLbool doCascadedShadows=false)
Construct a new SLLightDirect::SLLightDirect object.
SLfloat _sunLightPowerMin
Min. zenith power scale factor for sun.
SLfloat shadowTest(SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D) override
SLCol4f specular() override
Returns the product of the specular light color and the specular light power.
bool hitRec(SLRay *ray) override
SLVec3f spotDirWS() override
void renderShadowMap(SLSceneView *sv, SLNode *root) override
SLLight::renderShadowMap renders the shadow map of the light.
SLCol4f diffuse() override
Returns the product of the diffuse light color and the diffuse light power.
SLfloat _arrowLength
Length of direction line.
void createShadowMap(float clipNear=0.1f, float clipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024)) override
SLfloat _arrowRadius
The sphere lights radius.
void drawMesh(SLSceneView *sv) override
SLCol4f calculateSunLight(SLfloat standardPower)
Calculates the sunlight color depending on the zenith angle.
SLfloat shadowTestMC(SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D) override
SLbool doSunPowerAdaptation()
bool _doCascadedShadows
Cascaded shadow.
void doSunPowerAdaptation(SLbool enabled)
SLfloat dirLength() const
SLbool doCascadedShadows() const override
SLTexColorLUT _sunLightColorLUT
Sun light color LUT.
void createShadowMapAutoSize(SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=4) override
SLTexColorLUT * sunLightColorLUT()
void statsRec(SLNodeStats &stats) override
SLLightDirect::statsRec updates the statistic parameters.
Abstract Light class for OpenGL light sources.
SLNode represents a node in a hierarchical scene graph.
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
SLVec3f forwardOS() const
const SLMat4f & updateAndGetWM() const
Ray class with ray and intersection properties.
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
SLTexColorLUT defines a lookup table as an 1D texture of (256) RGBA values.
Struct for scene graph statistics.