@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.
105 lines (100 loc) • 3.66 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
// Do not edit.
const name$2 = "lightVxFragmentDeclaration";
const shader$2 = `
uniform vec4 vLightData{X};uniform vec4 vLightDiffuse{X};
uniform vec4 vLightSpecular{X};
vec4 vLightSpecular{X}=vec4(0.);
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
uniform vec4 shadowsInfo{X};uniform vec2 depthValues{X};
uniform vec4 vLightDirection{X};uniform vec4 vLightFalloff{X};
uniform vec4 vLightFalloff{X};
uniform vec3 vLightGround{X};
uniform vec4 vLightWidth{X};uniform vec4 vLightHeight{X};
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$2]) {
ShaderStore.IncludesShadersStore[name$2] = shader$2;
}
/** @internal */
const lightVxFragmentDeclaration = { name: name$2, shader: shader$2 };
// Do not edit.
const name$1 = "lightVxUboDeclaration";
const shader$1 = `
uniform Light{X}
{vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;
vec4 vLightDirection;vec4 vLightFalloff;
vec4 vLightFalloff;
vec3 vLightGround;
vec2 vSliceData;vec2 vSliceRanges[CLUSTLIGHT_SLICES];
vec4 vLightWidth;vec4 vLightHeight;
vec4 shadowsInfo;vec2 depthValues;} light{X};
uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];varying vec4 vPositionFromCamera{X};
varying vec4 vPositionFromLight{X};varying float vDepthMetric{X};uniform mat4 lightMatrix{X};
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name$1]) {
ShaderStore.IncludesShadersStore[name$1] = shader$1;
}
/** @internal */
const lightVxUboDeclaration = { name: name$1, shader: shader$1 };
// Do not edit.
const name = "shadowsVertex";
const shader = `
vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
}
vPositionFromLight{X}=lightMatrix{X}*worldPos;
vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name]) {
ShaderStore.IncludesShadersStore[name] = shader;
}
/** @internal */
const shadowsVertex = { name, shader };
export { lightVxUboDeclaration as a, lightVxFragmentDeclaration as l, shadowsVertex as s };
//# sourceMappingURL=shadowsVertex-BA-1OlXD.esm.js.map