@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 +6 -7
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +6 -7
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +1 -1
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:
|
|
2247
|
+
// --- ground: camera-centered, height-independent projection ---
|
|
2248
2248
|
let dyClamped = min(d.y, -0.0001);
|
|
2249
|
-
let
|
|
2250
|
-
let
|
|
2251
|
-
let hitZ = t * d.z;
|
|
2249
|
+
let ratio = d.x / dyClamped;
|
|
2250
|
+
let ratioZ = d.z / dyClamped;
|
|
2252
2251
|
|
|
2253
|
-
//
|
|
2254
|
-
let groundDir = normalize(vec3(
|
|
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 =
|
|
19087
|
+
this.skyboxRenderer.groundRadius = 0.3;
|
|
19089
19088
|
this.skyboxRenderer.prepareFrame(
|
|
19090
19089
|
this.camera.viewMatrix,
|
|
19091
19090
|
this.camera.projectionMatrix,
|