@d5techs/3dgs-lib 1.4.61 → 1.4.62
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 +39 -4
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +39 -4
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +1 -1
package/dist/3dgs-lib.js
CHANGED
|
@@ -2263,10 +2263,18 @@ fn dirToUv(d: vec3<f32>) -> vec2<f32> {
|
|
|
2263
2263
|
|
|
2264
2264
|
// --- sample both (uniform control flow) ---
|
|
2265
2265
|
let skyColor = textureSample(envTexture, envSampler, skyUv).rgb;
|
|
2266
|
-
let
|
|
2266
|
+
let hdrGround = textureSample(envTexture, envSampler, groundUv).rgb;
|
|
2267
|
+
|
|
2268
|
+
// Debug checkerboard to verify ground position
|
|
2269
|
+
let cx2 = floor(wx * 2.0);
|
|
2270
|
+
let cz2 = floor(wz * 2.0);
|
|
2271
|
+
let checker = ((cx2 + cz2) % 2.0 + 2.0) % 2.0;
|
|
2272
|
+
let checkerColor = mix(vec3(0.15, 0.15, 0.15), vec3(0.4, 0.4, 0.4), checker);
|
|
2273
|
+
// Mix HDR ground with subtle checker for position reference
|
|
2274
|
+
let groundColor = hdrGround * 0.8 + checkerColor * 0.2;
|
|
2267
2275
|
|
|
2268
2276
|
// Blend: horizon transition + fade at bowl edge
|
|
2269
|
-
let horizonBlend = smoothstep(0.0, -0.
|
|
2277
|
+
let horizonBlend = smoothstep(0.0, -0.05, d.y);
|
|
2270
2278
|
let aboveGround = step(0.01, cy);
|
|
2271
2279
|
let edgeFade = 1.0 - smoothstep(R * 0.7, R, wDist);
|
|
2272
2280
|
let finalBlend = horizonBlend * aboveGround * edgeFade;
|
|
@@ -2293,7 +2301,7 @@ class SkyboxRenderer {
|
|
|
2293
2301
|
__publicField(this, "frameReady", false);
|
|
2294
2302
|
__publicField(this, "mode", "none");
|
|
2295
2303
|
/** Ground projection sphere radius (world units). Larger = ground extends further, flatter. */
|
|
2296
|
-
__publicField(this, "groundRadius",
|
|
2304
|
+
__publicField(this, "groundRadius", 50);
|
|
2297
2305
|
this.device = device;
|
|
2298
2306
|
const depthStencil = {
|
|
2299
2307
|
format: depthFormat,
|
|
@@ -19071,10 +19079,37 @@ class App {
|
|
|
19071
19079
|
this.hotspotManager.updateBillboards();
|
|
19072
19080
|
if ((_a2 = this.skyboxRenderer) == null ? void 0 : _a2.isActive) {
|
|
19073
19081
|
const cam = this.camera.position;
|
|
19082
|
+
let groundLevel = 0;
|
|
19083
|
+
const gsRendererForGround = this.sceneManager.getGSRenderer();
|
|
19084
|
+
if (gsRendererForGround) {
|
|
19085
|
+
const bbox = gsRendererForGround.getBoundingBox();
|
|
19086
|
+
if (bbox) {
|
|
19087
|
+
const m = gsRendererForGround.getModelMatrix();
|
|
19088
|
+
groundLevel = m[5] * bbox.min[1] + m[13];
|
|
19089
|
+
if (!this._hdrDebugLogged) {
|
|
19090
|
+
this._hdrDebugLogged = true;
|
|
19091
|
+
console.log(
|
|
19092
|
+
"[HDR Ground Debug]",
|
|
19093
|
+
"bbox.min:",
|
|
19094
|
+
bbox.min,
|
|
19095
|
+
"bbox.max:",
|
|
19096
|
+
bbox.max,
|
|
19097
|
+
"bbox.center:",
|
|
19098
|
+
bbox.center,
|
|
19099
|
+
"groundLevel:",
|
|
19100
|
+
groundLevel,
|
|
19101
|
+
"cam:",
|
|
19102
|
+
[cam[0].toFixed(2), cam[1].toFixed(2), cam[2].toFixed(2)],
|
|
19103
|
+
"camH_effective:",
|
|
19104
|
+
(cam[1] - groundLevel).toFixed(2)
|
|
19105
|
+
);
|
|
19106
|
+
}
|
|
19107
|
+
}
|
|
19108
|
+
}
|
|
19074
19109
|
this.skyboxRenderer.prepareFrame(
|
|
19075
19110
|
this.camera.viewMatrix,
|
|
19076
19111
|
this.camera.projectionMatrix,
|
|
19077
|
-
[cam[0], cam[1], cam[2]]
|
|
19112
|
+
[cam[0], cam[1] - groundLevel, cam[2]]
|
|
19078
19113
|
);
|
|
19079
19114
|
}
|
|
19080
19115
|
const pass = this.renderer.beginFrame();
|