shadowsVertex.js 1.0 KB

123456789101112131415161718192021222324252627
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "shadowsVertex";
  4. const shader = `#ifdef SHADOWS
  5. #if defined(SHADOWCSM{X})
  6. vPositionFromCamera{X}=view*worldPos;for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {vPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;
  7. #ifdef USE_REVERSE_DEPTHBUFFER
  8. vDepthMetric{X}[i]=(-vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
  9. #else
  10. vDepthMetric{X}[i]=(vPositionFromLight{X}[i].z+light{X}.depthValues.x)/light{X}.depthValues.y;
  11. #endif
  12. }
  13. #elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
  14. vPositionFromLight{X}=lightMatrix{X}*worldPos;
  15. #ifdef USE_REVERSE_DEPTHBUFFER
  16. vDepthMetric{X}=(-vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
  17. #else
  18. vDepthMetric{X}=(vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
  19. #endif
  20. #endif
  21. #endif
  22. `;
  23. // Sideeffect
  24. ShaderStore.IncludesShadersStore[name] = shader;
  25. /** @internal */
  26. export const shadowsVertex = { name, shader };
  27. //# sourceMappingURL=shadowsVertex.js.map