@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.
95 lines (91 loc) • 3.14 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.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;
}
// 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;
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;
}
// 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;
}
//# sourceMappingURL=shadowsVertex-DGNF9E87.esm.js.map