@d5techs/3dgs-lib 1.4.66 → 1.4.68
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 +3 -4
- package/dist/3dgs-lib.cjs.map +1 -1
- package/dist/3dgs-lib.js +3 -4
- package/dist/3dgs-lib.js.map +1 -1
- package/package.json +1 -1
package/dist/3dgs-lib.js
CHANGED
|
@@ -2237,7 +2237,7 @@ fn dirToUv(d: vec3<f32>) -> vec2<f32> {
|
|
|
2237
2237
|
@fragment fn fs(i: V) -> @location(0) vec4<f32> {
|
|
2238
2238
|
let d = normalize(i.dir);
|
|
2239
2239
|
let cx = u.cam.x;
|
|
2240
|
-
let cy = u.cam.y;
|
|
2240
|
+
let cy = max(u.cam.y, 0.1); // clamp: camera always above ground
|
|
2241
2241
|
let cz = u.cam.z;
|
|
2242
2242
|
let captureH = u.cam.w;
|
|
2243
2243
|
|
|
@@ -2258,10 +2258,9 @@ fn dirToUv(d: vec3<f32>) -> vec2<f32> {
|
|
|
2258
2258
|
let skyColor = textureSample(envTexture, envSampler, skyUv).rgb;
|
|
2259
2259
|
let groundColor = textureSample(envTexture, envSampler, groundUv).rgb;
|
|
2260
2260
|
|
|
2261
|
-
// Sharp blend at horizon
|
|
2261
|
+
// Sharp blend at horizon — cy is always > 0 so no aboveGround check needed
|
|
2262
2262
|
let horizonBlend = smoothstep(0.002, -0.002, d.y);
|
|
2263
|
-
let
|
|
2264
|
-
let c = mix(skyColor, groundColor, horizonBlend * aboveGround);
|
|
2263
|
+
let c = mix(skyColor, groundColor, horizonBlend);
|
|
2265
2264
|
|
|
2266
2265
|
// Reinhard tone mapping + gamma
|
|
2267
2266
|
let mapped = c / (c + vec3(1.));
|