@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.15 kB
JavaScript
import{S as e}from"./index-BPURObVq.esm.min.js";import{h as i}from"./helperFunctions-Sht42MtG.esm.min.js";import{i as r,h as n}from"./hdrFilteringFunctions-Bir1R1RD.esm.min.js";import{p as o}from"./pbrBRDFFunctions-DaqCuli4.esm.min.js";const s="iblDominantDirectionPixelShader",t="precision highp sampler2D;precision highp samplerCube;\n#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nvarying vec2 vUV;uniform sampler2D icdfSampler;void main(void) {vec3 lightDir=vec3(0.0,0.0,0.0);for(uint i=0u; i<NUM_SAMPLES; ++i)\n{vec2 Xi=hammersley(i,NUM_SAMPLES);vec2 T;T.x=texture2D(icdfSampler,vec2(Xi.x,0.0)).x;T.y=texture2D(icdfSampler,vec2(T.x,Xi.y)).y;vec3 Ls=uv_to_normal(vec2(1.0-fract(T.x+0.25),T.y));lightDir+=Ls;}\nlightDir/=float(NUM_SAMPLES);gl_FragColor=vec4(lightDir,1.0);}";e.ShadersStore[s]||(e.ShadersStore[s]=t);const c=[i,r,o,n];for(const i of c)e.IncludesShadersStore[i.name]||(e.IncludesShadersStore[i.name]=i.shader);const m={name:s,shader:t};export{m as iblDominantDirectionPixelShader};
//# sourceMappingURL=iblDominantDirection.fragment-h1krLhL0.esm.min.js.map