5 parent=
"ShaderStorageBufferObjStdLayoutChunk"
7 pointerfieldtypes=
"both"
10 parentsystemcomponent=
"true"
12 useLocalIncludes=
"false"
13 docGroupBase=
"GrpSystemState"
15 See \ref PageSystemMultiLightChunk for a description.
17 This chunk represents a number of lights that are exposed to shader code
18 in form of a buffer in OpenGL std430 layout format.
19 A shader, binding a shader storage block to the very same binding point,
20 is expected to respect the corresponding block layout. The layout is regulated
21 by the hasXXX fields of the chunk. If one is set to false the corresponding
22 struct entry is omitted.
26 mat4 worldToLightSpaceMatrix;
27 mat4 lightToWorldSpaceMatrix;
28 mat4 eyeToLightSpaceMatrix;
29 mat4 lightToEyeSpaceMatrix;
30 mat4 lightPerspectiveMatrix;
31 mat4 invLightPerspectiveMatrix;
35 vec3 ambientIntensity;
36 vec3 diffuseIntensity;
37 vec3 specularIntensity;
39 float constantAttenuation;
40 float linearAttenuation;
41 float quadraticAttenuation;
46 float cosSpotlightAngle;
49 float innerSuperEllipsesWidth;
50 float innerSuperEllipsesHeight;
51 float outerSuperEllipsesWidth;
52 float outerSuperEllipsesHeight;
53 float superEllipsesRoundness;
54 float superEllipsesTwist;
59 layout (std430) buffer Lights
64 The chunk provides a convenient function that allows to adjust the struct layout
65 for standard OpenGL lights
71 vec3 ambientIntensity;
72 vec3 diffuseIntensity;
73 vec3 specularIntensity;
74 float constantAttenuation;
75 float linearAttenuation;
76 float quadraticAttenuation;
77 float cosSpotlightAngle;
83 or for simple range lights:
92 float cosSpotlightAngle;
98 name=
"hasWorldToLightSpaceMatrix"
101 visibility=
"external"
105 This flag determines if the worldToLightSpaceMatrix attribute is part of
106 the shader storage block, i.e. if the
"mat4 worldToLightSpaceMatrix;"
107 entry is contained in the shader struct for the Light.
111 name=
"hasLightToWorldSpaceMatrix"
114 visibility=
"external"
118 This flag determines if the lightToWorldSpaceMatrix attribute is part of
119 the shader storage block, i.e. if the
"mat4 lightToWorldSpaceMatrix;"
120 entry is contained in the shader struct for the Light.
124 name=
"hasEyeToLightSpaceMatrix"
127 visibility=
"external"
131 This flag determines if the eyeToLightSpaceMatrix attribute is part of
132 the shader storage block, i.e. if the
"mat4 eyeToLightSpaceMatrix;"
133 entry is contained in the shader struct for the Light.
134 Attention: If this flag is set the light shader storage block has to
135 be updated with every redraw operation.
139 name=
"hasLightToEyeSpaceMatrix"
142 visibility=
"external"
146 This flag determines if the lightToEyeSpaceMatrix attribute is part of
147 the shader storage block, i.e. if the
"mat4 lightToEyeSpaceMatrix;"
148 entry is contained in the shader struct for the Light.
149 Attention: If this flag is set the light shader storage block has to
150 be updated with every redraw operation.
154 name=
"hasLightPerspectiveMatrix"
157 visibility=
"external"
161 This flag determines if the lightPerspectiveMatrix attribute is part of
162 the shader storage block, i.e. if the
"mat4 lightPerspectiveMatrix;"
163 entry is contained in the shader struct for the Light.
167 name=
"hasInvLightPerspectiveMatrix"
170 visibility=
"external"
174 This flag determines if the lightToEyeSpaceMatrix attribute is part of
175 the shader storage block, i.e. if the
"mat4 invLightToEyeSpaceMatrix;"
176 entry is contained in the shader struct for the Light.
183 visibility=
"external"
187 This flag determines if the color attribute is part of the shader storage block, i.e.
188 if the
"vec3 color;" entry is contained in the shader struct for the Light.
195 visibility=
"external"
199 This flag determines if the intensity attribute is part of the shader storage block, i.e.
200 if the
"float intensity;" entry is contained in the shader struct for the Light.
204 name=
"hasSeparateIntensities"
207 visibility=
"external"
211 This flag determines if the color intensity attributes are part of the shader storage block, i.e.
212 if the
"vec3 Ia;",
"vec3 Id;" and
"vec3 Is;" entries are contained in the shader struct for the Light.
216 name=
"hasAttenuation"
219 visibility=
"external"
223 This flag determines if the attenuation attributes are part of the shader storage block, i.e.
224 if the
"float constantAttenuation;",
"float linearAttenuation;" and
"float quadraticAttenuation;"
225 entries are contained in the shader struct for the Light.
229 name=
"autoCalcRanges"
232 visibility=
"external"
236 If this flag is active and the lights have attenuations, then the cut on and cut off ranges
237 are automatically calculated. They are, however, not provided automatically to the shader.
238 For that, you have to set the hasRangeCutOn and hasRangeCutOff flags, respectively.
245 visibility=
"external"
249 This flag determines if the rangeCutOn attribute is part of the shader storage block, i.e.
250 if the
"float rangeCutOn;" entry is contained in the shader struct for the Light.
254 name=
"hasRangeCutOff"
257 visibility=
"external"
261 This flag determines if the hasRangeCutOff attribute is part of the shader storage block, i.e.
262 if the
"float hasRangeCutOff;" entry is contained in the shader struct for the Light.
266 name=
"hasRangeNearZone"
269 visibility=
"external"
273 This flag determines if the hasRangeNearZone attribute is part of the shader storage block, i.e.
274 if the
"float hasRangeNearZone;" entry is contained in the shader struct for the Light.
278 name=
"hasRangeFarZone"
281 visibility=
"external"
285 This flag determines if the hasRangeFarZone attribute is part of the shader storage block, i.e.
286 if the
"float hasRangeFarZone;" entry is contained in the shader struct for the Light.
290 name=
"hasCosSpotlightAngle"
293 visibility=
"external"
297 This flag determines if the cosine of the spot light angle attribute is part of the shader storage block, i.e.
298 if the
"float cosSpotlightAngle;" entry is contained in the shader struct for the Light. If neither this flag
299 nor the hasSpotlightAngle flag is true, then this flag is treated as if it has value true.
303 name=
"hasSpotlightAngle"
306 visibility=
"external"
310 This flag determines if the spot light angle attribute is part of the shader storage block, i.e.
311 if the
"float spotlightAngle;" entry is contained in the shader struct for the Light. If neither this flag
312 nor the hasCosSpotlightAngle flag is true, then the hasCosSpotlightAngle flag is treated as if it has value true.
316 name=
"hasSpotExponent"
319 visibility=
"external"
323 This flag determines if the spot expenent attribute is part of the shader storage block, i.e.
324 if the
"float spotExponent;" entry is contained in the shader struct for the Light.
328 name=
"hasCinemaLight"
331 visibility=
"external"
335 This flag determines if the cinema light attributes are part of the shader storage block, i.e.
336 if the
"float innerSuperEllipsesWidth;", ... entries are contained in the shader struct for the Light.
337 If true this flag overrides the hasRangeCutOn, hasRangeCutOff, hasRangeNearZone and hasRangeFarZone
338 flags, because cinema lights are described the corresponding attributes.
339 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
340 http://www.yaldex.com/open-gl/ch12lev1sec4.html
341 https://en.wikipedia.org/wiki/Superellipse
348 visibility=
"external"
351 The light's position for point and spotlights in beacon space.
358 visibility=
"external"
361 The light's direction for directional and spotlights in beacon space.
368 visibility=
"external"
378 visibility=
"external"
381 The light's intensity.
385 name=
"ambientIntensity"
388 visibility=
"external"
391 The light's ambient intensity.
395 name=
"diffuseIntensity"
398 visibility=
"external"
401 The light's diffuse intensity.
405 name=
"specularIntensity"
408 visibility=
"external"
411 The light's specular intensity.
418 visibility=
"external"
421 The light's attenuation consiting of the constant, linear and quadratic attenuation parts.
425 name=
"spotlightAngle"
428 visibility=
"external"
431 The spot angle in degree.
438 visibility=
"external"
441 The spot angle in degree.
445 name=
"innerSuperEllipsesWidth"
448 visibility=
"external"
451 The cinema light is described among others by an inner ellipses. This is
452 the width of this ellipse.
453 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
454 http://www.yaldex.com/open-gl/ch12lev1sec4.html
455 https://en.wikipedia.org/wiki/Superellipse
459 name=
"innerSuperEllipsesHeight"
462 visibility=
"external"
465 The cinema light is described among others by an inner ellipses. This is
466 the height of this ellipse.
467 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
468 http://www.yaldex.com/open-gl/ch12lev1sec4.html
469 https://en.wikipedia.org/wiki/Superellipse
473 name=
"outerSuperEllipsesWidth"
476 visibility=
"external"
479 The cinema light is described among others by an outer ellipses. This is
480 the width of this ellipse.
481 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
482 http://www.yaldex.com/open-gl/ch12lev1sec4.html
483 https://en.wikipedia.org/wiki/Superellipse
487 name=
"outerSuperEllipsesHeight"
490 visibility=
"external"
493 The cinema light is described among others by an outer ellipses. This is
494 the height of this ellipse.
495 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
496 http://www.yaldex.com/open-gl/ch12lev1sec4.html
497 https://en.wikipedia.org/wiki/Superellipse
501 name=
"superEllipsesRoundness"
504 visibility=
"external"
507 The cinema light is described among others by a roundness parameter.
508 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
509 http://www.yaldex.com/open-gl/ch12lev1sec4.html
510 https://en.wikipedia.org/wiki/Superellipse
514 name=
"superEllipsesTwist"
517 visibility=
"external"
520 The twist angle in degree by which the superellipses is rotatet in the xy-plane.
527 visibility=
"external"
530 The cinema light is described among others by a rangeCutOn parameter.
531 In the interval rangeCutOn to rangeCutOff the lighted fragments are
533 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
534 http://www.yaldex.com/open-gl/ch12lev1sec4.html
535 https://en.wikipedia.org/wiki/Superellipse
542 visibility=
"external"
545 The cinema light is described among others by a rangeCutOff parameter.
546 In the interval rangeCutOn to rangeCutOff the lighted fragments are
548 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
549 http://www.yaldex.com/open-gl/ch12lev1sec4.html
550 https://en.wikipedia.org/wiki/Superellipse
557 visibility=
"external"
560 The cinema light is described among others by a rangeNearZone parameter.
561 In the interval rangeCutOn-rangeNearZone to rangeCutOn the lighted fragments are
563 See: http://http.developer.nvidia.com/GPUGems/gpugems_ch10.html
564 http://www.yaldex.com/open-gl/ch12lev1sec4.html
565 https://en.wikipedia.org/wiki/Superellipse
572 visibility=
"external"
575 In the interval rangeCutOff to rangeCutOff+rangeFarZone the lighted fragments are
583 visibility=
"external"
586 Stores the light's type. This can be any of the set {POINT_LIGHT, DIRECTIONAL_LIGHT, SPOT_LIGHT, CINEMA_LIGHT}.
593 visibility=
"external"
596 The on/off state of the light.
602 category=
"weakpointer"
604 visibility=
"external"
607 The light's beacon determining its position or direction.
614 visibility=
"internal"
617 The beacon matrices used for the last render pass.
624 visibility=
"external"
628 The lights position and direction are transformed to eye space before loading into the shader.
629 On default they are provided in world space.
636 visibility=
"internal"
640 The camera last near value.
647 visibility=
"internal"
651 The camera last far value.
655 name=
"lastCamToWorld"
658 visibility=
"internal"
661 The camera last to world matrix.
665 name=
"LightBlockName"
668 visibility=
"external"
670 defaultValue='
"Lights"'
672 The shader storage buffer block name for the light buffer.
676 name=
"LightVariableName"
679 visibility=
"external"
681 defaultValue='
"lights"'
683 The shader variable name for the light buffer.