summaryrefslogtreecommitdiffstats
path: root/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-06-03 14:00:07 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2019-06-03 14:01:18 +0300
commit01cfc8025119609803b3fc00b1e8ca5bc56e84d0 (patch)
treec41480bbb06377f3a79d13c465a53435cccb9de4 /src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
parentc36739204786bd90df6e2ef5a8be78c980240bdd (diff)
parent089d283afb8cde5024e60c29eeeeefc5c3c80543 (diff)
Merge branch '2.4'
Diffstat (limited to 'src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib')
-rw-r--r--src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib b/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
new file mode 100644
index 00000000..cdb8c92a
--- /dev/null
+++ b/src/Runtime/ogl-runtime/res/effectlib/gles2/funcareaLightVars.glsllib
@@ -0,0 +1,29 @@
+#define MAX_AREA_LIGHTS 16
+
+// note this struct must exactly match the memory layout of the
+// struct SLightSourceShader in the source code. If you make changes here you need
+// to adjust the struct SLightSourceShader as well
+struct AreaLight
+{
+ 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;
+};
+
+uniform int uNumAreaLights;
+uniform AreaLight arealights[MAX_AREA_LIGHTS];