summaryrefslogtreecommitdiffstats
path: root/src/Runtime/ogl-runtime/res/effectlib/shadowMappingFragment.glsllib
blob: 660d736a69d7c88a25f7db71f729cd4c7a7a3fab (plain)
1
2
3
4
5
6
7
8
9
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);
}