@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
30 lines (27 loc) • 1.26 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.esm.js';
import './helperFunctions-4InRZPbu.esm.js';
// Do not edit.
const name = "iblScaledLuminancePixelShader";
const shader = `
var iblSourceSampler: sampler;var iblSource: texture_cube<f32>;
var iblSourceSampler: sampler;var iblSource: texture_2d<f32>;
uniform iblHeight: i32;uniform iblWidth: i32;fn fetchLuminance(coords: vec2f)->f32 {
var direction: vec3f=equirectangularToCubemapDirection(coords);var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,direction,0.0).rgb;
var color: vec3f=textureSampleLevel(iblSource,iblSourceSampler,coords,0.0).rgb;
return dot(color,LuminanceEncodeApprox);}
@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var deform: f32=sin(input.vUV.y*PI);var luminance: f32=fetchLuminance(input.vUV);fragmentOutputs.color=vec4f(vec3f(deform*luminance),1.0);}`;
// Sideeffect
if (!ShaderStore.ShadersStoreWGSL[name]) {
ShaderStore.ShadersStoreWGSL[name] = shader;
}
/** @internal */
const iblScaledLuminancePixelShaderWGSL = { name, shader };
export { iblScaledLuminancePixelShaderWGSL };
//# sourceMappingURL=iblScaledLuminance.fragment-BVAfc7JV.esm.js.map