UNPKG

@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.

3 lines (2 loc) 1.27 kB
import{S as e}from"./index-BPURObVq.esm.min.js";import{h as r}from"./helperFunctions-T6LSXWWf.esm.min.js";import{i,h as n}from"./hdrFilteringFunctions-oX9Sx_LC.esm.min.js";import{p as t}from"./pbrBRDFFunctions-DX0WY6z1.esm.min.js";const a="iblDominantDirectionPixelShader",m="#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvar icdfSamplerSampler: sampler;var icdfSampler: texture_2d<f32>;@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {var lightDir: vec3f=vec3f(0.0,0.0,0.0);for(var i: u32=0u; i<NUM_SAMPLES; i++)\n{var Xi: vec2f=hammersley(i,NUM_SAMPLES);var T: vec2f;T.x=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(Xi.x,0.0),0.0).x;T.y=textureSampleLevel(icdfSampler,icdfSamplerSampler,vec2(T.x,Xi.y),0.0).y;var Ls: vec3f=uv_to_normal(vec2f(1.0-fract(T.x+0.25),T.y));lightDir+=Ls;}\nlightDir/=vec3f(f32(NUM_SAMPLES));fragmentOutputs.color=vec4f(lightDir,1.0);}";e.ShadersStoreWGSL[a]||(e.ShadersStoreWGSL[a]=m);const s=[r,i,t,n];for(const r of s)e.IncludesShadersStoreWGSL[r.name]||(e.IncludesShadersStoreWGSL[r.name]=r.shader);const c={name:a,shader:m};export{c as iblDominantDirectionPixelShaderWGSL}; //# sourceMappingURL=iblDominantDirection.fragment-D2NYZG2Y.esm.min.js.map