@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.
71 lines (67 loc) • 2.96 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
// Do not edit.
const name$1 = "pbrFragmentReflectionDeclaration";
const shader$1 = `
uniform samplerCube reflectionSampler;
uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
uniform samplerCube irradianceSampler;
uniform sampler2D reflectionSampler;
uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
uniform sampler2D irradianceSampler;
varying vec3 vPositionUVW;
varying vec3 vDirectionW;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$1]) {
ShaderStore.IncludesShadersStore[name$1] = shader$1;
}
/** @internal */
const pbrFragmentReflectionDeclaration = { name: name$1, shader: shader$1 };
// Do not edit.
const name = "pbrIBLFunctions";
const shader = `
float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;}
float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;}
float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);}
float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);}
float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name]) {
ShaderStore.IncludesShadersStore[name] = shader;
}
/** @internal */
const pbrIBLFunctions = { name, shader };
export { pbrIBLFunctions as a, pbrFragmentReflectionDeclaration as p };
//# sourceMappingURL=pbrIBLFunctions-Bxq2HzKy.esm.js.map