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.

55 lines 2.48 kB
// Do not edit. import { ShaderStore } from "../../Engines/shaderStore.js"; const name = "shadowsVertex"; const shader = `#ifdef SHADOWS #if defined(SHADOWCSM{X}) vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos; #if SHADOWCSMNUM_CASCADES{X}>0 vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #if SHADOWCSMNUM_CASCADES{X}>1 vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #if SHADOWCSMNUM_CASCADES{X}>2 vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #if SHADOWCSMNUM_CASCADES{X}>3 vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X}) vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos; #ifdef USE_REVERSE_DEPTHBUFFER vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; #else vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y; #endif #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name]) { ShaderStore.IncludesShadersStoreWGSL[name] = shader; } /** @internal */ export const shadowsVertexWGSL = { name, shader }; //# sourceMappingURL=shadowsVertex.js.map