@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.
53 lines • 1.5 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 vUV: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
varying vDepthMetric: f32;
varying vViewPos: vec4f;
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
if (textureSample(diffuseSampler,diffuseSamplerSampler,input.vUV).a<0.4) {discard;}
fragmentOutputs.color=pack(input.vViewPos.z);
fragmentOutputs.color= vec4f(input.vViewPos.z,0.0,0.0,1.0);
fragmentOutputs.color=pack(input.position.z);
fragmentOutputs.color= vec4f(input.position.z,0.0,0.0,0.0);
fragmentOutputs.color=pack(input.vDepthMetric);
fragmentOutputs.color= vec4f(input.vDepthMetric,0.0,0.0,1.0);
}`;
// Sideeffect
if (!ShaderStore.ShadersStoreWGSL[name]) {
ShaderStore.ShadersStoreWGSL[name] = shader;
}
/** @internal */
export const depthPixelShaderWGSL = { name, shader };
//# sourceMappingURL=depth.fragment.js.map