playcanvas
Version:
PlayCanvas WebGL game engine
47 lines (45 loc) • 1.1 kB
JavaScript
var litShadowMainPS = `
uniform vec3 view_position;
uniform float light_radius;
void main(void) {
evaluateFrontend();
float depth = gl_FragCoord.z;
depth = linearizeDepthWithParams(depth, camera_params);
float depth = min(distance(view_position, vPositionW) / light_radius, 0.99999);
float exponent = 15.0;
float exponent = 5.54;
depth = 2.0 * depth - 1.0;
depth = exp(exponent * depth);
gl_FragColor = vec4(depth, depth*depth, 1.0, 1.0);
gl_FragColor.r = depth;
gl_FragDepth = depth;
gl_FragColor = vec4(1.0);
}
`;
export { litShadowMainPS as default };