157 virtual ortLight optixLight(
bool)
193 float lightClipFar = 20.0f,
198 int numCascades = 0) = 0;
vector< SLLight * > SLVLight
STL vector of light pointers.
SLVec2< SLfloat > SLVec2f
Active or visible camera node class.
Abstract Light class for OpenGL light sources.
void ambientColor(const SLCol4f &ambi)
virtual SLVec3f spotDirWS()=0
virtual SLfloat shadowTest(SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D)=0
SLint _id
OpenGL light number (0-7)
SLCol4f _ambientColor
Ambient light color (RGB 0-1)
SLuint _softShadowLevel
Radius to smoothing (1 = 3 * 3; 2 = 5 * 5; ...)
SLfloat _kc
Constant light attenuation.
SLfloat shadowMinBias() const
SLfloat _shadowMaxBias
Max. bias at 90 deg. to use to prevent shadow acne.
SLfloat attenuation(SLfloat dist) const
SLbool createsShadows() const
virtual SLbool doCascadedShadows() const
SLShadowMap * _shadowMap
Used for shadow mapping.
static SLfloat gamma
final output gamma value
SLfloat diffusePower() const
virtual ~SLLight()=default
void shadowMaxBias(SLfloat maxBias)
SLbool doSoftShadows() const
void shadowMap(SLShadowMap *shadowMap)
virtual SLCol4f specular()=0
Returns normally _specularColor * _specularPower.
SLfloat _diffusePower
Diffuse light power (0-N)
SLbool _isAttenuated
fast attenuation flag for ray tracing
SLfloat spotCutOffDEG() const
SLbool isAttenuated() const
SLbool _isOn
Flag if light is on or off.
virtual SLVec4f positionWS() const =0
SLfloat ambientPower() const
static SLbool doColoredShadows
flag if shadows should be displayed with colors for debugging
static SLCol4f globalAmbient
static global ambient light intensity
SLfloat _kq
Quadratic light attenuation.
void ambientPower(const SLfloat ambPow)
void ambiDiffPowers(SLfloat ambiPow, SLfloat diffPow, const SLCol4f &ambiDiffCol=SLCol4f::WHITE)
Sets the ambient and diffuse powers with the same color.
SLfloat spotCosCut() const
void doSmoothShadows(SLbool doSS)
SLfloat _specularPower
Specular light power (0-N)
static SLfloat oneOverGamma()
void specularPower(const SLfloat specPow)
void isOn(const SLbool on)
SLfloat specularPower() const
virtual void renderShadowMap(SLSceneView *sv, SLNode *root)
SLLight::renderShadowMap renders the shadow map of the light.
virtual void createShadowMap(float lightClipNear=0.1f, float lightClipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024))=0
SLLight(SLfloat ambiPower=0.1f, SLfloat diffPower=1.0f, SLfloat specPower=1.0f, SLint id=-1)
Construct a new SLLight::SLLight object.
virtual void createShadowMapAutoSize(SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=0)=0
SLfloat _spotExponent
Spot attenuation from center to edge of cone.
SLuint softShadowLevel() const
SLCol4f _diffuseColor
Diffuse light color (RGB 0-1)
SLShadowMap * shadowMap()
void smoothShadowLevel(SLuint ssLevel)
virtual SLCol4f diffuse()=0
Returns normally _diffuseColor * _diffusePower.
SLfloat _spotCutOffDEG
Half the spot cone angle.
SLfloat _ambientPower
Ambient light power (0-N)
virtual SLCol4f ambient()=0
Return normally _ambientColor * _ambientPower.
SLbool _createsShadows
flag if light creates shadows or not
SLfloat _shadowMinBias
Min. bias at 0 deg. to use to prevent shadow acne.
void diffusePower(const SLfloat diffPow)
void diffuseColor(const SLCol4f &diff)
SLfloat _spotCosCutOffRAD
cosine of spotCutoff angle
void specularColor(const SLCol4f &spec)
virtual SLfloat shadowTestMC(SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D)=0
SLfloat spotExponent() const
SLfloat shadowMaxBias() const
SLfloat _kl
Linear light attenuation.
SLbool _doSoftShadows
flag if percentage-closer filtering for smooth shadows is enabled
SLCol4f _specularColor
Specular light color (RGB 0-1)
void ambiDiffColor(const SLCol4f &ambiDiffCol)
Sets the same color to the ambient and diffuse colors.
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
void powers(SLfloat ambiPow, SLfloat diffPow, SLfloat specPow, const SLCol4f &ambiDiffSpecCol=SLCol4f::WHITE)
Sets the ambient, diffuse and specular powers all with the same color.
void shadowMinBias(SLfloat minBias)
void spotExponent(const SLfloat exp)
SLNode represents a node in a hierarchical scene graph.
Ray class with ray and intersection properties.
SceneView class represents a dynamic real time 3D view onto the scene.
Class for standard and cascaded shadow mapping.
Struct for uniform buffer with std140 layout.