UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

29 lines 1.1 kB
// Do not edit. import { ShaderStore } from "../../Engines/shaderStore.js"; const name = "shadowsVertex"; const shader = `#ifdef SHADOWS #if defined(SHADOWCSM{X}) vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif } #elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X}) vPositionFromLight{X}=lightMatrix{X}*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStore[name]) { ShaderStore.IncludesShadersStore[name] = shader; } /** @internal */ export const shadowsVertex = { name, shader }; //# sourceMappingURL=shadowsVertex.js.map