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.

29 lines 1.03 kB
// Do not edit. import { ShaderStore } from "../Engines/shaderStore.js"; import "./ShadersInclude/helperFunctions.js"; const name = "layerPixelShader"; const shader = `varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform color: vec4f; #include<helperFunctions> #define CUSTOM_FRAGMENT_DEFINITIONS @fragment fn main(input: FragmentInputs)->FragmentOutputs { #define CUSTOM_FRAGMENT_MAIN_BEGIN var baseColor: vec4f=textureSample(textureSampler,textureSamplerSampler,input.vUV); #if defined(CONVERT_TO_GAMMA) baseColor=toGammaSpace(baseColor); #elif defined(CONVERT_TO_LINEAR) baseColor=toLinearSpaceVec4(baseColor); #endif #ifdef ALPHATEST if (baseColor.a<0.4) {discard;} #endif fragmentOutputs.color=baseColor*uniforms.color; #define CUSTOM_FRAGMENT_MAIN_END }`; // Sideeffect if (!ShaderStore.ShadersStoreWGSL[name]) { ShaderStore.ShadersStoreWGSL[name] = shader; } /** @internal */ export const layerPixelShaderWGSL = { name, shader }; //# sourceMappingURL=layer.fragment.js.map