@d5techs/3dgs-lib 1.4.58 → 1.4.59

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
@@ -2251,9 +2251,10 @@ fn dirToUv(d: vec3<f32>) -> vec2<f32> {
2251
2251
  let hitZ = t * d.z;
2252
2252
  let hitDist = sqrt(hitX * hitX + hitZ * hitZ);
2253
2253
 
2254
- // Reconstruct a sampling direction as if looking from HDR capture
2255
- // height (1.7m) straight down at the hit point → FLAT ground
2256
- let captureH = 1.7;
2254
+ // Re-map to a direction on the HDR sphere from a virtual capture
2255
+ // height above ground. Larger = more ground texture visible,
2256
+ // smaller = more horizon. 15 matches Three.js GroundProjectedEnv default.
2257
+ let captureH = 15.0;
2257
2258
  let groundDir = normalize(vec3(hitX, -captureH, hitZ));
2258
2259
  let groundUv = dirToUv(groundDir);
2259
2260
 
@@ -2289,7 +2290,7 @@ class SkyboxRenderer {
2289
2290
  __publicField(this, "frameReady", false);
2290
2291
  __publicField(this, "mode", "none");
2291
2292
  /** Ground projection sphere radius (world units). Larger = ground extends further, flatter. */
2292
- __publicField(this, "groundRadius", 500);
2293
+ __publicField(this, "groundRadius", 1e3);
2293
2294
  this.device = device;
2294
2295
  const depthStencil = {
2295
2296
  format: depthFormat,
@@ -2408,7 +2409,7 @@ class SkyboxRenderer {
2408
2409
  this.mode = "equirect";
2409
2410
  }
2410
2411
  // ---- common ----
2411
- prepareFrame(viewMatrix, projectionMatrix, cameraPosition, groundY) {
2412
+ prepareFrame(viewMatrix, projectionMatrix, cameraPosition) {
2412
2413
  if (!this.isActive) {
2413
2414
  this.frameReady = false;
2414
2415
  return;
@@ -2426,9 +2427,7 @@ class SkyboxRenderer {
2426
2427
  ud[9] = viewMatrix[9];
2427
2428
  ud[10] = viewMatrix[10];
2428
2429
  ud[11] = 0;
2429
- const camWorldY = cameraPosition ? cameraPosition[1] : 0;
2430
- const gndY = groundY ?? 0;
2431
- ud[12] = camWorldY - gndY;
2430
+ ud[12] = cameraPosition ? cameraPosition[1] : 0;
2432
2431
  ud[13] = this.groundRadius;
2433
2432
  ud[14] = 0;
2434
2433
  ud[15] = 0;
@@ -19069,20 +19068,10 @@ class App {
19069
19068
  this.hotspotManager.updateBillboards();
19070
19069
  if ((_a2 = this.skyboxRenderer) == null ? void 0 : _a2.isActive) {
19071
19070
  const cam = this.camera.position;
19072
- let groundY = 0;
19073
- const gsRenderer2 = this.sceneManager.getGSRenderer();
19074
- if (gsRenderer2) {
19075
- const bbox = gsRenderer2.getBoundingBox();
19076
- if (bbox) {
19077
- const m = gsRenderer2.getModelMatrix();
19078
- groundY = m[5] * bbox.min[1] + m[13];
19079
- }
19080
- }
19081
19071
  this.skyboxRenderer.prepareFrame(
19082
19072
  this.camera.viewMatrix,
19083
19073
  this.camera.projectionMatrix,
19084
- [cam[0], cam[1], cam[2]],
19085
- groundY
19074
+ [cam[0], cam[1], cam[2]]
19086
19075
  );
19087
19076
  }
19088
19077
  const pass = this.renderer.beginFrame();