@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
39 lines • 1.2 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../../Engines/shaderStore.js";
const name = "shadowMapFragment";
const shader = `float depthSM=vDepthMetricSM;
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
depthSM=(-zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
depthSM=(zSM+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
depthSM=clamp(depthSM,0.0,1.0);
gl_FragDepth=clamp(1.0-depthSM,0.0,1.0);
gl_FragDepth=clamp(depthSM,0.0,1.0);
depthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/depthValuesSM.y+biasAndScaleSM.x;
depthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);
gl_FragColor=vec4(depthSM,1.0,1.0,1.0);
gl_FragColor=pack(depthSM);
return;`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name]) {
ShaderStore.IncludesShadersStore[name] = shader;
}
/** @internal */
export const shadowMapFragment = { name, shader };
//# sourceMappingURL=shadowMapFragment.js.map