summaryrefslogtreecommitdiffstats
path: root/src/Runtime/res/effectlib/funccalculatePointLightAttenuation.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/funccalculatePointLightAttenuation.glsllib
Initial import
Diffstat (limited to 'src/Runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib')
-rw-r--r--src/Runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib b/src/Runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib
new file mode 100644
index 00000000..5f421622
--- /dev/null
+++ b/src/Runtime/res/effectlib/funccalculatePointLightAttenuation.glsllib
@@ -0,0 +1,4 @@
+float calculatePointLightAttenuation(vec3 attenuationConstants, float lightDistance ) {
+ return 1.0 / (attenuationConstants.x + attenuationConstants.y * lightDistance
+ + attenuationConstants.z * lightDistance * lightDistance);
+}