@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.
67 lines (63 loc) • 3.17 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
// Do not edit.
const name$1 = "pbrFragmentReflectionDeclaration";
const shader$1 = `
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;
varying vPositionUVW: vec3f;
varying vDirectionW: vec3f;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) {
ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1;
}
/** @internal */
const pbrFragmentReflectionDeclarationWGSL = { name: name$1, shader: shader$1 };
// Do not edit.
const name = "pbrIBLFunctions";
const shader = `
fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}
fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}
fn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;}
fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}
fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
/** @internal */
const pbrIBLFunctionsWGSL = { name, shader };
export { pbrIBLFunctionsWGSL as a, pbrFragmentReflectionDeclarationWGSL as p };
//# sourceMappingURL=pbrIBLFunctions-D4-ZLWWt.esm.js.map