@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.
31 lines (28 loc) • 1.68 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
import { h as helperFunctionsWGSL } from './helperFunctions-CiGzvr6_.esm.js';
import { i as importanceSamplingWGSL, h as hdrFilteringFunctionsWGSL } from './hdrFilteringFunctions-CwvCr5Ba.esm.js';
import { p as pbrBRDFFunctionsWGSL } from './pbrBRDFFunctions-DpNLaDYY.esm.js';
// Do not edit.
const name = "iblDominantDirectionPixelShader";
const shader = `#include<helperFunctions>
#include<importanceSampling>
#include<pbrBRDFFunctions>
#include<hdrFilteringFunctions>
var icdfSamplerSampler: sampler;var icdfSampler: texture_2d<f32>;@fragment
fn main(input: FragmentInputs)->FragmentOutputs {var lightDir: vec3f=vec3f(0.0,0.0,0.0);for(var i: u32=0u; i<NUM_SAMPLES; i++)
{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;}
lightDir/=vec3f(f32(NUM_SAMPLES));fragmentOutputs.color=vec4f(lightDir,1.0);}`;
// Sideeffect
if (!ShaderStore.ShadersStoreWGSL[name]) {
ShaderStore.ShadersStoreWGSL[name] = shader;
}
const includes = [helperFunctionsWGSL, importanceSamplingWGSL, pbrBRDFFunctionsWGSL, hdrFilteringFunctionsWGSL];
for (const inc of includes) {
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
}
}
/** @internal */
const iblDominantDirectionPixelShaderWGSL = { name, shader };
export { iblDominantDirectionPixelShaderWGSL };
//# sourceMappingURL=iblDominantDirection.fragment-CTa2OmM9.esm.js.map