@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.
76 lines • 2.63 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import "./ShadersInclude/helperFunctions.js";
import "./ShadersInclude/clipPlaneFragmentDeclaration.js";
import "./ShadersInclude/clipPlaneFragment.js";
const name = "glowMapGenerationPixelShader";
const shader = `
varying vUVDiffuse: vec2f;var diffuseSamplerSampler: sampler;var diffuseSampler: texture_2d<f32>;
varying vUVOpacity: vec2f;var opacitySamplerSampler: sampler;var opacitySampler: texture_2d<f32>;uniform opacityIntensity: f32;
varying vUVEmissive: vec2f;var emissiveSamplerSampler: sampler;var emissiveSampler: texture_2d<f32>;
varying vColor: vec4f;
uniform glowColor: vec4f;uniform glowIntensity: f32;
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {
var finalColor: vec4f=uniforms.glowColor;
var albedoTexture: vec4f=textureSample(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vUVDiffuse);
albedoTexture=toGammaSpace(albedoTexture);
finalColor=vec4f(finalColor.rgb,finalColor.a*albedoTexture.a);
finalColor=vec4f(finalColor.rgb,albedoTexture.a);
var opacityMap: vec4f=textureSample(opacitySampler,opacitySamplerSampler,fragmentInputs.vUVOpacity);
finalColor=vec4f(finalColor.rgb,finalColor.a*getLuminance(opacityMap.rgb));
finalColor=vec4f(finalColor.rgb,finalColor.a*opacityMap.a);
finalColor=vec4f(finalColor.rgb,finalColor.a*uniforms.opacityIntensity);
finalColor=vec4f(finalColor.rgb,finalColor.a*fragmentInputs.vColor.a);
if (finalColor.a<ALPHATESTVALUE) {discard;}
var emissive: vec4f=textureSample(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vUVEmissive);
emissive=toGammaSpace(emissive);
fragmentOutputs.color=emissive*finalColor*uniforms.glowIntensity;
fragmentOutputs.color=finalColor*uniforms.glowIntensity;
fragmentOutputs.color=vec4f(fragmentOutputs.color.rgb,uniforms.glowColor.a);
}
`;
// Sideeffect
if (!ShaderStore.ShadersStoreWGSL[name]) {
ShaderStore.ShadersStoreWGSL[name] = shader;
}
/** @internal */
export const glowMapGenerationPixelShaderWGSL = { name, shader };
//# sourceMappingURL=glowMapGeneration.fragment.js.map