@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.
27 lines • 1.06 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import "./ShadersInclude/helperFunctions.js";
const name = "iblScaledLuminancePixelShader";
const shader = `precision highp sampler2D;precision highp samplerCube;
varying vec2 vUV;
uniform samplerCube iblSource;
uniform sampler2D iblSource;
uniform int iblWidth;uniform int iblHeight;float fetchLuminance(vec2 coords) {
vec3 direction=equirectangularToCubemapDirection(coords);vec3 color=textureCubeLodEXT(iblSource,direction,0.0).rgb;
vec3 color=textureLod(iblSource,coords,0.0).rgb;
return dot(color,LuminanceEncodeApprox);}
void main(void) {float deform=sin(vUV.y*PI);float luminance=fetchLuminance(vUV);gl_FragColor=vec4(vec3(deform*luminance),1.0);}`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
export const iblScaledLuminancePixelShader = { name, shader };
//# sourceMappingURL=iblScaledLuminance.fragment.js.map