summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/funcsampleLightVars.glsllib
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-10-06 11:49:09 +0000
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-10-06 16:58:43 +0200
commit07840524085bd1785b8f9142b03d942f678c5c51 (patch)
tree499c1674fdd1b3e0c07688d8e4e56748dfea2ca3 /src/Runtime/res/effectlib/funcsampleLightVars.glsllib
Initial import
Diffstat (limited to 'src/Runtime/res/effectlib/funcsampleLightVars.glsllib')
-rw-r--r--src/Runtime/res/effectlib/funcsampleLightVars.glsllib29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Runtime/res/effectlib/funcsampleLightVars.glsllib b/src/Runtime/res/effectlib/funcsampleLightVars.glsllib
new file mode 100644
index 00000000..85ca1448
--- /dev/null
+++ b/src/Runtime/res/effectlib/funcsampleLightVars.glsllib
@@ -0,0 +1,29 @@
+#define MAX_NUM_LIGHTS 16
+
+struct LightSource
+{
+ vec4 position;
+ vec4 direction; // Specifies the light direction in world coordinates.
+ vec4 up;
+ vec4 right;
+ vec4 diffuse;
+ vec4 ambient;
+ vec4 specular;
+ float spotExponent; // Specifies the intensity distribution of the light.
+ float spotCutoff; // Specifies the maximum spread angle of the light.
+ float constantAttenuation; // Specifies the constant light attenuation factor.
+ float linearAttenuation; // Specifies the linear light attenuation factor.
+ float quadraticAttenuation; // Specifies the quadratic light attenuation factor.
+ float range; // Specifies the maximum distance of the light influence
+ float width; // Specifies the width of the area light surface.
+ float height; // Specifies the height of the area light surface;
+ vec4 shadowControls;
+ mat4 shadowView;
+ int shadowIdx;
+};
+
+layout (std140) uniform cbBufferLights
+{
+ int uNumLights;
+ LightSource lights[MAX_NUM_LIGHTS];
+};