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) 994 B
import{S as i}from"./index-Bw2N6w1y.esm.min.js";import"./helperFunctions-VdqKNhfd.esm.min.js";import"./hdrFilteringFunctions-nlKk1C7U.esm.min.js";import"./pbrBRDFFunctions-CN3j6T4p.esm.min.js";const e="iblDominantDirectionPixelShader",n="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);}";i.ShadersStore[e]||(i.ShadersStore[e]=n);const r={name:e,shader:n};export{r as iblDominantDirectionPixelShader}; //# sourceMappingURL=iblDominantDirection.fragment-BRNMPQPS.esm.min.js.map