@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.47 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import { clipPlaneFragmentDeclaration } from "./ShadersInclude/clipPlaneFragmentDeclaration.js";
import { clipPlaneFragment } from "./ShadersInclude/clipPlaneFragment.js";
const name = "selectionPixelShader";
const shader = `
flat varying float vSelectionId;
uniform float selectionId;
varying float vViewPosZ;
varying float vDepthMetric;
varying vec2 vUV;uniform sampler2D diffuseSampler;
void main(void) {
if (texture2D(diffuseSampler,vUV).a<0.4)
discard;
float id=vSelectionId;
float id=selectionId;
gl_FragColor=vec4(id,vViewPosZ,0.0,1.0);
gl_FragColor=vec4(id,vDepthMetric,0.0,1.0);
}
`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
const includes = [clipPlaneFragmentDeclaration, clipPlaneFragment];
for (const inc of includes) {
if (!ShaderStore.IncludesShadersStore[inc.name]) {
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
}
}
/** @internal */
export const selectionPixelShader = { name, shader };
//# sourceMappingURL=selection.fragment.js.map