summaryrefslogtreecommitdiffstats
path: root/res/effectlib/shadowMappingFragment.glsllib
diff options
context:
space:
mode:
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);
+}