@solidrt/3d 0.0.59 → 0.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { createDrawTarget, depthTexture, destroyTexture, limits, setTargetRect, setTargetSize } from "@solidrt/core/gpu"
11
11
  import type { ShaderParams, TextureId } from "@solidrt/core/gpu"
12
- import { cascadeSplit, copy, frustumSliceSphere, lookAt as lookAtMatrix, mat4, snapToGrid, transformVector } from "./math.ts"
12
+ import { cascadeBoundary, copy, frustumSliceSphere, lookAt as lookAtMatrix, mat4, snapToGrid, transformVector } from "./math.ts"
13
13
  import type { Mat4, Vec3 } from "./math.ts"
14
14
  import { MAX_LIGHTS, MAX_SHADOW_MAPS } from "./glsl.ts"
15
15
  import { shadowDepthMaterial } from "./material.ts"
@@ -389,7 +389,8 @@ export function makeShadowSystem<V extends ShadowView>(deps: ShadowSystemDeps<V>
389
389
  return
390
390
  }
391
391
  // Cascades: the scene camera's range near..far (far capped by
392
- // shadow.distance) sliced by cascadeSplit, each slice's bounding
392
+ // shadow.distance) sliced by cascadeBoundary (the light's explicit
393
+ // splits, or the practical split), each slice's bounding
393
394
  // sphere (frustumSliceSphere) as an orthographic box looking along
394
395
  // the light, its centre snapped to the map's texel grid in light
395
396
  // space (snapToGrid) so the shadow edges do not swim as the camera
@@ -406,7 +407,7 @@ export function makeShadowSystem<V extends ShadowView>(deps: ShadowSystemDeps<V>
406
407
  let aspect = size.width / size.height
407
408
  let zn = near
408
409
  for (let c = 0; c < n; c++) {
409
- let zf = cascadeSplit(near, far, c, n, CASCADE_SPLIT_LAMBDA)
410
+ let zf = cascadeBoundary(near, far, c, n, CASCADE_SPLIT_LAMBDA, light.shadow.splits)
410
411
  let radius = frustumSliceSphere(cascadeCenter, camera, aspect, zn, zf)
411
412
  zn = zf
412
413
  let view = shadow.views[c]!