SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLLight Class Referenceabstract

Abstract Light class for OpenGL light sources. More...

#include <SLLight.h>

Inheritance diagram for SLLight:
[legend]

Public Member Functions

 SLLight (SLfloat ambiPower=0.1f, SLfloat diffPower=1.0f, SLfloat specPower=1.0f, SLint id=-1)
 Construct a new SLLight::SLLight object. More...
 
virtual ~SLLight ()=default
 
void id (const SLint id)
 
void isOn (const SLbool on)
 
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. More...
 
void ambiDiffPowers (SLfloat ambiPow, SLfloat diffPow, const SLCol4f &ambiDiffCol=SLCol4f::WHITE)
 Sets the ambient and diffuse powers with the same color. More...
 
void ambiDiffColor (const SLCol4f &ambiDiffCol)
 Sets the same color to the ambient and diffuse colors. More...
 
void ambientColor (const SLCol4f &ambi)
 
void ambientPower (const SLfloat ambPow)
 
void diffuseColor (const SLCol4f &diff)
 
void diffusePower (const SLfloat diffPow)
 
void specularColor (const SLCol4f &spec)
 
void specularPower (const SLfloat specPow)
 
void spotExponent (const SLfloat exp)
 
void spotCutOffDEG (SLfloat cutOffAngleDEG)
 
void kc (SLfloat kc)
 
void kl (SLfloat kl)
 
void kq (SLfloat kq)
 
void attenuation (const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
 
void createsShadows (SLbool createsShadows)
 
void shadowMap (SLShadowMap *shadowMap)
 
void doSmoothShadows (SLbool doSS)
 
void smoothShadowLevel (SLuint ssLevel)
 
void shadowMinBias (SLfloat minBias)
 
void shadowMaxBias (SLfloat maxBias)
 
SLint id () const
 
SLbool isOn () const
 
SLCol4f ambientColor ()
 
SLfloat ambientPower () const
 
SLCol4f diffuseColor ()
 
SLfloat diffusePower () const
 
SLCol4f specularColor ()
 
SLfloat specularPower () const
 
SLfloat spotCutOffDEG () const
 
SLfloat spotCosCut () const
 
SLfloat spotExponent () const
 
SLfloat kc () const
 
SLfloat kl () const
 
SLfloat kq () const
 
SLbool isAttenuated () const
 
SLfloat attenuation (SLfloat dist) const
 
SLbool createsShadows () const
 
SLShadowMapshadowMap ()
 
SLbool doSoftShadows () const
 
SLuint softShadowLevel () const
 
SLfloat shadowMinBias () const
 
SLfloat shadowMaxBias () const
 
virtual SLbool doCascadedShadows () const
 
virtual SLCol4f ambient ()=0
 Return normally _ambientColor * _ambientPower. More...
 
virtual SLCol4f diffuse ()=0
 Returns normally _diffuseColor * _diffusePower. More...
 
virtual SLCol4f specular ()=0
 Returns normally _specularColor * _specularPower. More...
 
virtual SLVec4f positionWS () const =0
 
virtual SLVec3f spotDirWS ()=0
 
virtual SLfloat shadowTest (SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D)=0
 
virtual SLfloat shadowTestMC (SLRay *ray, const SLVec3f &L, SLfloat lightDist, SLNode *root3D)=0
 
virtual void createShadowMap (float lightClipNear=0.1f, float lightClipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024))=0
 
virtual void createShadowMapAutoSize (SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=0)=0
 
virtual void renderShadowMap (SLSceneView *sv, SLNode *root)
 SLLight::renderShadowMap renders the shadow map of the light. More...
 

Static Public Member Functions

static SLfloat oneOverGamma ()
 

Static Public Attributes

static SLCol4f globalAmbient = SLCol4f(0.1f, 0.1f, 0.1f, 1.0f)
 static global ambient light intensity More...
 
static SLfloat gamma = 1.0f
 final output gamma value More...
 
static SLbool doColoredShadows = false
 flag if shadows should be displayed with colors for debugging More...
 

Protected Attributes

SLint _id
 OpenGL light number (0-7) More...
 
SLbool _isOn
 Flag if light is on or off. More...
 
SLCol4f _ambientColor
 Ambient light color (RGB 0-1) More...
 
SLfloat _ambientPower
 Ambient light power (0-N) More...
 
SLCol4f _diffuseColor
 Diffuse light color (RGB 0-1) More...
 
SLfloat _diffusePower
 Diffuse light power (0-N) More...
 
SLCol4f _specularColor
 Specular light color (RGB 0-1) More...
 
SLfloat _specularPower
 Specular light power (0-N) More...
 
SLfloat _spotCutOffDEG
 Half the spot cone angle. More...
 
SLfloat _spotCosCutOffRAD
 cosine of spotCutoff angle More...
 
SLfloat _spotExponent
 Spot attenuation from center to edge of cone. More...
 
SLfloat _kc
 Constant light attenuation. More...
 
SLfloat _kl
 Linear light attenuation. More...
 
SLfloat _kq
 Quadratic light attenuation. More...
 
SLbool _isAttenuated
 fast attenuation flag for ray tracing More...
 
SLbool _createsShadows
 flag if light creates shadows or not More...
 
SLShadowMap_shadowMap
 Used for shadow mapping. More...
 
SLbool _doSoftShadows
 flag if percentage-closer filtering for smooth shadows is enabled More...
 
SLuint _softShadowLevel
 Radius to smoothing (1 = 3 * 3; 2 = 5 * 5; ...) More...
 
SLfloat _shadowMinBias
 Min. bias at 0 deg. to use to prevent shadow acne. More...
 
SLfloat _shadowMaxBias
 Max. bias at 90 deg. to use to prevent shadow acne. More...
 

Detailed Description

Abstract Light class for OpenGL light sources.

The abstract SLLight class encapsulates an invisible light source according to the OpenGL specification. The derivatives SLLightSpot and SLLightRect will also derive from SLNode and can therefore be freely placed in space.

Definition at line 60 of file SLLight.h.

Constructor & Destructor Documentation

◆ SLLight()

SLLight::SLLight ( SLfloat  ambiPower = 0.1f,
SLfloat  diffPower = 1.0f,
SLfloat  specPower = 1.0f,
SLint  id = -1 
)
explicit

Construct a new SLLight::SLLight object.

Remarks
It is important that during instantiation NO OpenGL functions (gl*) get called because this constructor will be most probably called in a parallel thread from within an SLScene::registerAssetsToLoad or SLScene::assemble function. All objects that get rendered have to do their OpenGL initialization when they are used the first time during rendering in the main thread.
Parameters
ambiPowerAmbient light power
diffPowerDiffuse light power
specPowerSpecular light power
idLight ID

Definition at line 30 of file SLLight.cpp.

34 {
35  // Set parameter of SLLight
36  _id = id;
37  _isOn = true;
38  _spotCutOffDEG = 180.0f;
40  _spotExponent = 1.0f;
41  _createsShadows = false;
42  _shadowMap = nullptr;
43  _doSoftShadows = false;
44  _softShadowLevel = 1;
45  _shadowMinBias = 0.001f;
46  _shadowMaxBias = 0.008f;
47 
48  // Set parameters of inherited SLMaterial
49  _ambientColor.set(1, 1, 1);
50  _ambientPower = ambiPower;
51  _diffuseColor.set(1, 1, 1);
52  _diffusePower = diffPower;
53  _specularColor.set(1, 1, 1);
54  _specularPower = specPower;
55 
56  // By default, there is no attenuation set. This is physically not correct
57  // Default OpenGL: kc=1, kl=0, kq=0
58  // Physically correct: kc=0, kl=0, kq=1
59  // set quadratic attenuation with d = distance to light
60  // 1
61  // attenuation = ------------------
62  // kc + kl*d + kq*d*d
63 
64  // init values to avoid used of uninitialized values
65  _kc=1.0f;
66  _kl=0.0f;
67  _kq=0.0f;
68 
69  kc(1.0f);
70  kl(0.0f);
71  kq(0.0f);
72 }
SLfloat kc() const
Definition: SLLight.h:143
SLint _id
OpenGL light number (0-7)
Definition: SLLight.h:208
SLCol4f _ambientColor
Ambient light color (RGB 0-1)
Definition: SLLight.h:210
SLuint _softShadowLevel
Radius to smoothing (1 = 3 * 3; 2 = 5 * 5; ...)
Definition: SLLight.h:226
SLfloat _kc
Constant light attenuation.
Definition: SLLight.h:219
SLfloat _shadowMaxBias
Max. bias at 90 deg. to use to prevent shadow acne.
Definition: SLLight.h:228
SLShadowMap * _shadowMap
Used for shadow mapping.
Definition: SLLight.h:224
SLfloat kq() const
Definition: SLLight.h:145
SLfloat _diffusePower
Diffuse light power (0-N)
Definition: SLLight.h:213
SLbool _isOn
Flag if light is on or off.
Definition: SLLight.h:209
SLfloat _kq
Quadratic light attenuation.
Definition: SLLight.h:221
SLfloat _specularPower
Specular light power (0-N)
Definition: SLLight.h:215
SLfloat _spotExponent
Spot attenuation from center to edge of cone.
Definition: SLLight.h:218
SLCol4f _diffuseColor
Diffuse light color (RGB 0-1)
Definition: SLLight.h:212
SLfloat _spotCutOffDEG
Half the spot cone angle.
Definition: SLLight.h:216
SLfloat _ambientPower
Ambient light power (0-N)
Definition: SLLight.h:211
SLbool _createsShadows
flag if light creates shadows or not
Definition: SLLight.h:223
SLfloat _shadowMinBias
Min. bias at 0 deg. to use to prevent shadow acne.
Definition: SLLight.h:227
SLfloat _spotCosCutOffRAD
cosine of spotCutoff angle
Definition: SLLight.h:217
SLfloat _kl
Linear light attenuation.
Definition: SLLight.h:220
SLbool _doSoftShadows
flag if percentage-closer filtering for smooth shadows is enabled
Definition: SLLight.h:225
SLfloat kl() const
Definition: SLLight.h:144
SLCol4f _specularColor
Specular light color (RGB 0-1)
Definition: SLLight.h:214
SLint id() const
Definition: SLLight.h:132
void set(const T X, const T Y, const T Z, const T W=1)
Definition: SLVec4.h:49
static const float DEG2RAD
Definition: Utils.h:239

◆ ~SLLight()

virtual SLLight::~SLLight ( )
virtualdefault

Member Function Documentation

◆ ambiDiffColor()

void SLLight::ambiDiffColor ( const SLCol4f ambiDiffCol)
inline

Sets the same color to the ambient and diffuse colors.

Definition at line 99 of file SLLight.h.

100  {
101  _ambientColor = ambiDiffCol;
102  _diffuseColor = ambiDiffCol;
103  }

◆ ambiDiffPowers()

void SLLight::ambiDiffPowers ( SLfloat  ambiPow,
SLfloat  diffPow,
const SLCol4f ambiDiffCol = SLCol4f::WHITE 
)
inline

Sets the ambient and diffuse powers with the same color.

Definition at line 88 of file SLLight.h.

91  {
92  _ambientColor = ambiDiffCol;
93  _diffuseColor = ambiDiffCol;
94  _ambientPower = ambiPow;
95  _diffusePower = diffPow;
96  }

◆ ambient()

virtual SLCol4f SLLight::ambient ( )
pure virtual

Return normally _ambientColor * _ambientPower.

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ ambientColor() [1/2]

SLCol4f SLLight::ambientColor ( )
inline

Definition at line 134 of file SLLight.h.

134 { return _ambientColor; }

◆ ambientColor() [2/2]

void SLLight::ambientColor ( const SLCol4f ambi)
inline

Definition at line 105 of file SLLight.h.

105 { _ambientColor = ambi; }

◆ ambientPower() [1/2]

SLfloat SLLight::ambientPower ( ) const
inline

Definition at line 135 of file SLLight.h.

135 { return _ambientPower; }

◆ ambientPower() [2/2]

void SLLight::ambientPower ( const SLfloat  ambPow)
inline

Definition at line 106 of file SLLight.h.

106 { _ambientPower = ambPow; }

◆ attenuation() [1/2]

void SLLight::attenuation ( const SLfloat  kConstant,
const SLfloat  kLinear,
const SLfloat  kQuadratic 
)
inline

Definition at line 116 of file SLLight.h.

119  {
120  kc(kConstant);
121  kl(kLinear);
122  kq(kQuadratic);
123  }

◆ attenuation() [2/2]

SLfloat SLLight::attenuation ( SLfloat  dist) const
inline

Definition at line 147 of file SLLight.h.

147 { return std::min(1.0f / (_kc + _kl * dist + _kq * dist * dist), 1.0f); }

◆ createShadowMap()

virtual void SLLight::createShadowMap ( float  lightClipNear = 0.1f,
float  lightClipFar = 20.0f,
SLVec2f  size = SLVec2f(8, 8),
SLVec2i  texSize = SLVec2i(1024, 1024) 
)
pure virtual

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ createShadowMapAutoSize()

virtual void SLLight::createShadowMapAutoSize ( SLCamera camera,
SLVec2i  texSize = SLVec2i(1024, 1024),
int  numCascades = 0 
)
pure virtual

Implemented in SLLightDirect, SLLightSpot, and SLLightRect.

◆ createsShadows() [1/2]

SLbool SLLight::createsShadows ( ) const
inline

Definition at line 148 of file SLLight.h.

148 { return _createsShadows; }

◆ createsShadows() [2/2]

void SLLight::createsShadows ( SLbool  createsShadows)

Definition at line 98 of file SLLight.cpp.

99 {
101 }
SLbool createsShadows() const
Definition: SLLight.h:148

◆ diffuse()

virtual SLCol4f SLLight::diffuse ( )
pure virtual

Returns normally _diffuseColor * _diffusePower.

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ diffuseColor() [1/2]

SLCol4f SLLight::diffuseColor ( )
inline

Definition at line 136 of file SLLight.h.

136 { return _diffuseColor; }

◆ diffuseColor() [2/2]

void SLLight::diffuseColor ( const SLCol4f diff)
inline

Definition at line 107 of file SLLight.h.

107 { _diffuseColor = diff; }

◆ diffusePower() [1/2]

SLfloat SLLight::diffusePower ( ) const
inline

Definition at line 137 of file SLLight.h.

137 { return _diffusePower; }

◆ diffusePower() [2/2]

void SLLight::diffusePower ( const SLfloat  diffPow)
inline

Definition at line 108 of file SLLight.h.

108 { _diffusePower = diffPow; }

◆ doCascadedShadows()

virtual SLbool SLLight::doCascadedShadows ( ) const
inlinevirtual

Reimplemented in SLLightDirect.

Definition at line 154 of file SLLight.h.

154 { return false; }

◆ doSmoothShadows()

void SLLight::doSmoothShadows ( SLbool  doSS)
inline

Definition at line 126 of file SLLight.h.

126 { _doSoftShadows = doSS; }

◆ doSoftShadows()

SLbool SLLight::doSoftShadows ( ) const
inline

Definition at line 150 of file SLLight.h.

150 { return _doSoftShadows; }

◆ id() [1/2]

SLint SLLight::id ( ) const
inline

Definition at line 132 of file SLLight.h.

132 { return _id; }

◆ id() [2/2]

void SLLight::id ( const SLint  id)
inline

Definition at line 70 of file SLLight.h.

70 { _id = id; }

◆ isAttenuated()

SLbool SLLight::isAttenuated ( ) const
inline

Definition at line 146 of file SLLight.h.

146 { return _isAttenuated; }
SLbool _isAttenuated
fast attenuation flag for ray tracing
Definition: SLLight.h:222

◆ isOn() [1/2]

SLbool SLLight::isOn ( ) const
inline

Definition at line 133 of file SLLight.h.

133 { return _isOn; }

◆ isOn() [2/2]

void SLLight::isOn ( const SLbool  on)
inline

Definition at line 71 of file SLLight.h.

71 { _isOn = on; }

◆ kc() [1/2]

SLfloat SLLight::kc ( ) const
inline

Definition at line 143 of file SLLight.h.

143 { return _kc; }

◆ kc() [2/2]

void SLLight::kc ( SLfloat  kc)

Definition at line 74 of file SLLight.cpp.

75 {
76  _kc = kc;
77  _isAttenuated = !(_kc == 1.0f && _kl == 0.0f && _kq == 0.0f);
78 }

◆ kl() [1/2]

SLfloat SLLight::kl ( ) const
inline

Definition at line 144 of file SLLight.h.

144 { return _kl; }

◆ kl() [2/2]

void SLLight::kl ( SLfloat  kl)

Definition at line 80 of file SLLight.cpp.

81 {
82  _kl = kl;
83  _isAttenuated = !(_kc == 1.0f && _kl == 0.0f && _kq == 0.0f);
84 }

◆ kq() [1/2]

SLfloat SLLight::kq ( ) const
inline

Definition at line 145 of file SLLight.h.

145 { return _kq; }

◆ kq() [2/2]

void SLLight::kq ( SLfloat  kq)

Definition at line 86 of file SLLight.cpp.

87 {
88  _kq = kq;
89  _isAttenuated = !(_kc == 1.0f && _kl == 0.0f && _kq == 0.0f);
90 }

◆ oneOverGamma()

static SLfloat SLLight::oneOverGamma ( )
inlinestatic

Definition at line 203 of file SLLight.h.

203 { return 1.0f / gamma; }
static SLfloat gamma
final output gamma value
Definition: SLLight.h:204

◆ positionWS()

virtual SLVec4f SLLight::positionWS ( ) const
pure virtual

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ powers()

void SLLight::powers ( SLfloat  ambiPow,
SLfloat  diffPow,
SLfloat  specPow,
const SLCol4f ambiDiffSpecCol = SLCol4f::WHITE 
)
inline

Sets the ambient, diffuse and specular powers all with the same color.

Definition at line 74 of file SLLight.h.

78  {
79  _ambientColor = ambiDiffSpecCol;
80  _diffuseColor = ambiDiffSpecCol;
81  _specularColor = ambiDiffSpecCol;
82  _ambientPower = ambiPow;
83  _diffusePower = diffPow;
84  _specularPower = specPow;
85  }

◆ renderShadowMap()

void SLLight::renderShadowMap ( SLSceneView sv,
SLNode root 
)
virtual

SLLight::renderShadowMap renders the shadow map of the light.

Reimplemented in SLLightDirect.

Definition at line 104 of file SLLight.cpp.

105 {
106  // Check if no shadow map was created at load time
107  if (!_shadowMap)
108  {
109  this->createShadowMap();
110  }
111 
112  _shadowMap->renderShadows(sv, root);
113 }
virtual void createShadowMap(float lightClipNear=0.1f, float lightClipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024))=0
void renderShadows(SLSceneView *sv, SLNode *root)

◆ shadowMap() [1/2]

SLShadowMap* SLLight::shadowMap ( )
inline

Definition at line 149 of file SLLight.h.

149 { return _shadowMap; }

◆ shadowMap() [2/2]

void SLLight::shadowMap ( SLShadowMap shadowMap)
inline

Definition at line 125 of file SLLight.h.

125 { _shadowMap = shadowMap; }
SLShadowMap * shadowMap()
Definition: SLLight.h:149

◆ shadowMaxBias() [1/2]

SLfloat SLLight::shadowMaxBias ( ) const
inline

Definition at line 153 of file SLLight.h.

153 { return _shadowMaxBias; }

◆ shadowMaxBias() [2/2]

void SLLight::shadowMaxBias ( SLfloat  maxBias)
inline

Definition at line 129 of file SLLight.h.

129 { _shadowMaxBias = maxBias; }

◆ shadowMinBias() [1/2]

SLfloat SLLight::shadowMinBias ( ) const
inline

Definition at line 152 of file SLLight.h.

152 { return _shadowMinBias; }

◆ shadowMinBias() [2/2]

void SLLight::shadowMinBias ( SLfloat  minBias)
inline

Definition at line 128 of file SLLight.h.

128 { _shadowMinBias = minBias; }

◆ shadowTest()

virtual SLfloat SLLight::shadowTest ( SLRay ray,
const SLVec3f L,
SLfloat  lightDist,
SLNode root3D 
)
pure virtual

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ shadowTestMC()

virtual SLfloat SLLight::shadowTestMC ( SLRay ray,
const SLVec3f L,
SLfloat  lightDist,
SLNode root3D 
)
pure virtual

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ smoothShadowLevel()

void SLLight::smoothShadowLevel ( SLuint  ssLevel)
inline

Definition at line 127 of file SLLight.h.

127 { _softShadowLevel = ssLevel; }

◆ softShadowLevel()

SLuint SLLight::softShadowLevel ( ) const
inline

Definition at line 151 of file SLLight.h.

151 { return _softShadowLevel; }

◆ specular()

virtual SLCol4f SLLight::specular ( )
pure virtual

Returns normally _specularColor * _specularPower.

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ specularColor() [1/2]

SLCol4f SLLight::specularColor ( )
inline

Definition at line 138 of file SLLight.h.

138 { return _specularColor; }

◆ specularColor() [2/2]

void SLLight::specularColor ( const SLCol4f spec)
inline

Definition at line 109 of file SLLight.h.

109 { _specularColor = spec; }

◆ specularPower() [1/2]

SLfloat SLLight::specularPower ( ) const
inline

Definition at line 139 of file SLLight.h.

139 { return _specularPower; }

◆ specularPower() [2/2]

void SLLight::specularPower ( const SLfloat  specPow)
inline

Definition at line 110 of file SLLight.h.

110 { _specularPower = specPow; }

◆ spotCosCut()

SLfloat SLLight::spotCosCut ( ) const
inline

Definition at line 141 of file SLLight.h.

141 { return _spotCosCutOffRAD; }

◆ spotCutOffDEG() [1/2]

SLfloat SLLight::spotCutOffDEG ( ) const
inline

Definition at line 140 of file SLLight.h.

140 { return _spotCutOffDEG; }

◆ spotCutOffDEG() [2/2]

void SLLight::spotCutOffDEG ( SLfloat  cutOffAngleDEG)

Definition at line 92 of file SLLight.cpp.

93 {
94  _spotCutOffDEG = cutOffAngleDEG;
96 }

◆ spotDirWS()

virtual SLVec3f SLLight::spotDirWS ( )
pure virtual

Implemented in SLLightSpot, SLLightRect, and SLLightDirect.

◆ spotExponent() [1/2]

SLfloat SLLight::spotExponent ( ) const
inline

Definition at line 142 of file SLLight.h.

142 { return _spotExponent; }

◆ spotExponent() [2/2]

void SLLight::spotExponent ( const SLfloat  exp)
inline

Definition at line 111 of file SLLight.h.

111 { _spotExponent = exp; }

Member Data Documentation

◆ _ambientColor

SLCol4f SLLight::_ambientColor
protected

Ambient light color (RGB 0-1)

Definition at line 210 of file SLLight.h.

◆ _ambientPower

SLfloat SLLight::_ambientPower
protected

Ambient light power (0-N)

Definition at line 211 of file SLLight.h.

◆ _createsShadows

SLbool SLLight::_createsShadows
protected

flag if light creates shadows or not

Definition at line 223 of file SLLight.h.

◆ _diffuseColor

SLCol4f SLLight::_diffuseColor
protected

Diffuse light color (RGB 0-1)

Definition at line 212 of file SLLight.h.

◆ _diffusePower

SLfloat SLLight::_diffusePower
protected

Diffuse light power (0-N)

Definition at line 213 of file SLLight.h.

◆ _doSoftShadows

SLbool SLLight::_doSoftShadows
protected

flag if percentage-closer filtering for smooth shadows is enabled

Definition at line 225 of file SLLight.h.

◆ _id

SLint SLLight::_id
protected

OpenGL light number (0-7)

Definition at line 208 of file SLLight.h.

◆ _isAttenuated

SLbool SLLight::_isAttenuated
protected

fast attenuation flag for ray tracing

Definition at line 222 of file SLLight.h.

◆ _isOn

SLbool SLLight::_isOn
protected

Flag if light is on or off.

Definition at line 209 of file SLLight.h.

◆ _kc

SLfloat SLLight::_kc
protected

Constant light attenuation.

Definition at line 219 of file SLLight.h.

◆ _kl

SLfloat SLLight::_kl
protected

Linear light attenuation.

Definition at line 220 of file SLLight.h.

◆ _kq

SLfloat SLLight::_kq
protected

Quadratic light attenuation.

Definition at line 221 of file SLLight.h.

◆ _shadowMap

SLShadowMap* SLLight::_shadowMap
protected

Used for shadow mapping.

Definition at line 224 of file SLLight.h.

◆ _shadowMaxBias

SLfloat SLLight::_shadowMaxBias
protected

Max. bias at 90 deg. to use to prevent shadow acne.

Definition at line 228 of file SLLight.h.

◆ _shadowMinBias

SLfloat SLLight::_shadowMinBias
protected

Min. bias at 0 deg. to use to prevent shadow acne.

Definition at line 227 of file SLLight.h.

◆ _softShadowLevel

SLuint SLLight::_softShadowLevel
protected

Radius to smoothing (1 = 3 * 3; 2 = 5 * 5; ...)

Definition at line 226 of file SLLight.h.

◆ _specularColor

SLCol4f SLLight::_specularColor
protected

Specular light color (RGB 0-1)

Definition at line 214 of file SLLight.h.

◆ _specularPower

SLfloat SLLight::_specularPower
protected

Specular light power (0-N)

Definition at line 215 of file SLLight.h.

◆ _spotCosCutOffRAD

SLfloat SLLight::_spotCosCutOffRAD
protected

cosine of spotCutoff angle

Definition at line 217 of file SLLight.h.

◆ _spotCutOffDEG

SLfloat SLLight::_spotCutOffDEG
protected

Half the spot cone angle.

Definition at line 216 of file SLLight.h.

◆ _spotExponent

SLfloat SLLight::_spotExponent
protected

Spot attenuation from center to edge of cone.

Definition at line 218 of file SLLight.h.

◆ doColoredShadows

SLbool SLLight::doColoredShadows = false
static

flag if shadows should be displayed with colors for debugging

Definition at line 205 of file SLLight.h.

◆ gamma

SLfloat SLLight::gamma = 1.0f
static

final output gamma value

Definition at line 204 of file SLLight.h.

◆ globalAmbient

SLCol4f SLLight::globalAmbient = SLCol4f(0.1f, 0.1f, 0.1f, 1.0f)
static

static global ambient light intensity

Definition at line 202 of file SLLight.h.


The documentation for this class was generated from the following files: