UNPKG

@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.

47 lines 1.18 kB
// Do not edit. import { ShaderStore } from "../Engines/shaderStore.js"; import "./ShadersInclude/clipPlaneFragmentDeclaration.js"; import "./ShadersInclude/clipPlaneFragment.js"; const name = "selectionPixelShader"; const shader = `#ifdef INSTANCES flat varying float vSelectionId; #else uniform float selectionId; #endif #ifdef STORE_CAMERASPACE_Z varying float vViewPosZ; #else varying float vDepthMetric; #endif #ifdef ALPHATEST varying vec2 vUV;uniform sampler2D diffuseSampler; #endif #include<clipPlaneFragmentDeclaration> #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN #include<clipPlaneFragment> #ifdef ALPHATEST if (texture2D(diffuseSampler,vUV).a<0.4) discard; #endif #ifdef INSTANCES float id=vSelectionId; #else float id=selectionId; #endif #ifdef STORE_CAMERASPACE_Z gl_FragColor=vec4(id,vViewPosZ,0.0,1.0); #else gl_FragColor=vec4(id,vDepthMetric,0.0,1.0); #endif #define CUSTOM_FRAGMENT_MAIN_END } `; // Sideeffect if (!ShaderStore.ShadersStore[name]) { ShaderStore.ShadersStore[name] = shader; } /** @internal */ export const selectionPixelShader = { name, shader }; //# sourceMappingURL=selection.fragment.js.map