@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.
54 lines • 1.28 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import "./ShadersInclude/clipPlaneFragmentDeclaration.js";
import "./ShadersInclude/packingFunctions.js";
import "./ShadersInclude/clipPlaneFragment.js";
const name = "depthPixelShader";
const shader = `
varying vec2 vUV;uniform sampler2D diffuseSampler;
varying float vDepthMetric;
varying vec4 vViewPos;
void main(void)
{
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
gl_FragColor=pack(vViewPos.z);
gl_FragColor=vec4(vViewPos.z,0.0,0.0,1.0);
gl_FragColor=pack(gl_FragCoord.z);
gl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);
gl_FragColor=pack(vDepthMetric);
gl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);
}`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
export const depthPixelShader = { name, shader };
//# sourceMappingURL=depth.fragment.js.map