@d5techs/3dgs-lib 1.4.69 → 1.4.70

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.
package/dist/3dgs-lib.cjs CHANGED
@@ -2246,14 +2246,13 @@ fn dirToUv(d: vec3<f32>) -> vec2<f32> {
2246
2246
  // --- sky: sample HDR with original direction ---
2247
2247
  let skyUv = dirToUv(d);
2248
2248
 
2249
- // --- ground: ray→plane at Y=0, camera-centered (no world XZ offset) ---
2249
+ // --- ground: camera-centered, height-independent projection ---
2250
2250
  let dyClamped = min(d.y, -0.0001);
2251
- let t = -cy / dyClamped;
2252
- let hitX = t * d.x;
2253
- let hitZ = t * d.z;
2251
+ let ratio = d.x / dyClamped;
2252
+ let ratioZ = d.z / dyClamped;
2254
2253
 
2255
- // Direction from virtual capture point to ground hit point
2256
- let groundDir = normalize(vec3(hitX, -captureH, hitZ));
2254
+ // K = captureH controls ground spread (smaller = more horizon, larger = more nadir)
2255
+ let groundDir = normalize(vec3(-ratio, -captureH, -ratioZ));
2257
2256
  let groundUv = dirToUv(groundDir);
2258
2257
 
2259
2258
  // --- sample both (uniform control flow) ---
@@ -19087,7 +19086,7 @@ class App {
19087
19086
  );
19088
19087
  }
19089
19088
  const camH = cam[1] - groundLevel;
19090
- this.skyboxRenderer.groundRadius = 50;
19089
+ this.skyboxRenderer.groundRadius = 0.3;
19091
19090
  this.skyboxRenderer.prepareFrame(
19092
19091
  this.camera.viewMatrix,
19093
19092
  this.camera.projectionMatrix,