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.

21 lines 1 kB
// Do not edit. import { ShaderStore } from "../Engines/shaderStore.js"; const name = "volumetricLightingBlendVolumePixelShader"; const shader = `varying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D depthSampler;uniform mat4 invProjection;uniform vec2 outputTextureSize; #ifdef USE_EXTINCTION uniform vec3 extinction; #endif #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) {gl_FragColor=texture2D(textureSampler,vUV); #ifdef USE_EXTINCTION float depth=texelFetch(depthSampler,ivec2(gl_FragCoord.xy),0).r;vec4 ndc=vec4((gl_FragCoord.xy/outputTextureSize)*2.-1.,depth*2.-1.,1.0);vec4 viewPos=invProjection*ndc;viewPos=viewPos/viewPos.w;float eyeDist=length(viewPos);gl_FragColor2=vec4(exp(-extinction*eyeDist),1.0); #endif } `; // Sideeffect if (!ShaderStore.ShadersStore[name]) { ShaderStore.ShadersStore[name] = shader; } /** @internal */ export const volumetricLightingBlendVolumePixelShader = { name, shader }; //# sourceMappingURL=volumetricLightingBlendVolume.fragment.js.map