summaryrefslogtreecommitdiffstats
path: root/basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag
diff options
context:
space:
mode:
authorMikko Gronoff <mikko.gronoff@qt.io>2018-09-14 10:25:01 +0300
committerMikko Gronoff <mikko.gronoff@qt.io>2018-09-14 10:27:21 +0300
commit97863a4992276a3d1aeb3c1bb9ef5a280a5e8b12 (patch)
treeb38f6f152e7036b91c25834a917e320955660db2 /basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag
parent8be609623fc646e8d9642fc8481a1b9e59fb8417 (diff)
parentaa8e21cc3f60e54dd9c5d1ec482ca440857568f0 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
* origin/5.11: aa8e21c Add new Qt3D demo ca03367 Exclude demos from colibri imx6ull a5345fd qtwebbrowser: merge changes from qtwebbrowser git repo d7e9731 do not enable highdpiscaling on emulator f730907 Fix mediaplayer default video path 09aa32d Fix some major scaling & font issues on ebike-demo Change-Id: I044c29ea2908a6254f32b0623037ea63f23d25cb
Diffstat (limited to 'basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag')
-rw-r--r--basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag25
1 files changed, 25 insertions, 0 deletions
diff --git a/basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag b/basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag
new file mode 100644
index 0000000..0b64263
--- /dev/null
+++ b/basicsuite/advancedcustommaterial/shaders/gl3/light.inc.frag
@@ -0,0 +1,25 @@
+const int MAX_LIGHTS = 8;
+const int TYPE_POINT = 0;
+const int TYPE_DIRECTIONAL = 1;
+const int TYPE_SPOT = 2;
+struct Light {
+ int type;
+ vec3 position;
+ vec3 color;
+ float intensity;
+ vec3 direction;
+ float constantAttenuation;
+ float linearAttenuation;
+ float quadraticAttenuation;
+ float cutOffAngle;
+};
+uniform Light lights[MAX_LIGHTS];
+uniform int lightCount;
+
+// Pre-convolved environment maps
+struct EnvironmentLight {
+ samplerCube irradiance; // For diffuse contribution
+ samplerCube specular; // For specular contribution
+};
+uniform EnvironmentLight envLight;
+uniform int envLightCount = 0;