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