@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.01 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 vec2 vUVDiffuse;uniform sampler2D diffuseSampler;
varying vec2 vUVOpacity;uniform sampler2D opacitySampler;uniform float opacityIntensity;
varying vec2 vUVEmissive;uniform sampler2D emissiveSampler;
varying vec4 vColor;
uniform vec4 glowColor;uniform float glowIntensity;
void main(void)
{
vec4 finalColor=glowColor;
vec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);
albedoTexture=toGammaSpace(albedoTexture);
finalColor.a*=albedoTexture.a;
finalColor.a=albedoTexture.a;
vec4 opacityMap=texture2D(opacitySampler,vUVOpacity);
finalColor.a*=getLuminance(opacityMap.rgb);
finalColor.a*=opacityMap.a;
finalColor.a*=opacityIntensity;
finalColor.a*=vColor.a;
if (finalColor.a<ALPHATESTVALUE)
discard;
vec4 emissive=texture2D(emissiveSampler,vUVEmissive);
emissive=toGammaSpace(emissive);
gl_FragColor=emissive*finalColor*glowIntensity;
gl_FragColor=finalColor*glowIntensity;
gl_FragColor.a=glowColor.a;
}`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
export const glowMapGenerationPixelShader = { name, shader };
//# sourceMappingURL=glowMapGeneration.fragment.js.map