summaryrefslogtreecommitdiffstats
path: root/res/effectlib/shadowMappingFragment.glsllib
diff options
context:
space:
mode:
authorPasi Keränen <pasi.keranen@qt.io>2019-06-06 16:22:02 +0300
committerPasi Keränen <pasi.keranen@qt.io>2019-06-07 13:52:44 +0300
commitb4954701093739e7a4e54a0669f306922d0d4605 (patch)
tree73d71319a921234f6b507c9098fdc842f7fe06dc /res/effectlib/shadowMappingFragment.glsllib
parent8548a5f5579e3eee7e5ae6b1f6901dcc8bfee19e (diff)
Long live the slayer!
Initial commit of OpenGL Runtime to repository. Based on SHA1 61823aaccc6510699a54b34a2fe3f7523dab3b4e of qt3dstudio repository. Task-number: QT3DS-3600 Change-Id: Iaeb80237399f0e5656a19ebec9d1ab3a681d8832 Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Diffstat (limited to 'res/effectlib/shadowMappingFragment.glsllib')
-rw-r--r--res/effectlib/shadowMappingFragment.glsllib10
1 files changed, 10 insertions, 0 deletions
diff --git a/res/effectlib/shadowMappingFragment.glsllib b/res/effectlib/shadowMappingFragment.glsllib
new file mode 100644
index 0000000..660d736
--- /dev/null
+++ b/res/effectlib/shadowMappingFragment.glsllib
@@ -0,0 +1,10 @@
+#include "depthpass.glsllib"
+float FragmentParaboloidDepth( vec4 inWorldPos, mat4 inMVP, vec2 inCameraProperties )
+{
+ if (inWorldPos.w < 0.0)
+ discard;
+ vec4 projVec = inMVP * vec4( inWorldPos.xyz, 1.0 );
+ projVec /= projVec.w;
+ projVec.z = depthValueToLinearDistance( 1.0 - projVec.z, inCameraProperties );
+ return (projVec.z - inCameraProperties.x) / (inCameraProperties.y - inCameraProperties.x);
+}