cockpit/GeoHelix: tame the Iceland needle field (4.2× cap) + terrain atmosphere (drifting clouds + sun-glint)#96
Conversation
…Iceland needle field Diagnosis (not a data problem): the /garmin/iceland v8-grid is the full 16.5 M-vert DEM — 10,192 distinct height levels, ~zero isolated spikes — so the height data is NOT quantized. The needle-hair on Iceland's steep coasts/ridges is real rugged ~100 m fjord/ridge detail amplified by the auto-exaggeration: 0.11/span drives Iceland (true-scale span ~0.0067) to ~16×, versus the canyon's ~2.2×. At 16× every real thin ridge becomes a needle. Fix: cap the auto-exaggeration at a modest 4.2×. Iceland clamps 16×→4.2× and reads as a clean island with real relief (mountains, glacier caps, fjords, highland valleys) instead of a hairball; the canyon sits at 2.2× (below the cap) so it is UNCHANGED — verified by re-render (walls still read as walls, the drape overlay intact). Client-side only: no asset regeneration, no new .DEM parser — the "dequantize" framing was a misnomer, the real lever was the exaggeration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
…gated sun-glint/ice-sheen Magic pass on the geo terrain shader, the "Fresnel/specular for ice caps + waves" direction made real, layered onto the 4.2× relief: - DRIFTING CLOUD SHADOWS — a world-fixed 2-octave value-noise field scrolled by uTime dapples soft moving shade across the terrain (atmosphere + a real sense of scale). Terrain scenes advance uTime and redraw, THROTTLED to ~15 fps (slow clouds need no more) so the continuous redraw of a heavy DEM stays cheap on battery; anatomy/buildings never enter this branch and stay fully on-demand (zero idle cost). - SUN-GLINT + ICE-SHEEN — a Blinn specular term gated by KIND on the RAW aColor (not the hypsometric render): ocean (blue-dominant, Iceland Ocean [26,62,104]) → a tight bright sun-glitter that brightens where the clouds part; ice/snow (near-white, Iceland Ice [238,244,252]) → a broad soft sheen. The canyon's grey terrain KIND ([150,150,150]) triggers NEITHER, so its hypsometric-white peaks stay matte — no false glacier shine. The vertex shader now computes the relief + view-space position up front so the glint has a correct view vector; vColor gains headroom (→1.8) so the glitter pops toward white. Verified by render: on the canyon (864 K verts) the cloud shadows visibly dapple the plateau, the rim stays matte (KIND-gating), the drape overlay is intact, and the 2.2× relief is unchanged. On Iceland (16.5 M verts, captured static — the animated scene is too heavy for headless swiftshader) the clouds dapple ocean + land and the 4.2× relief reads crisp. The ocean sun-glitter is view-angle-dependent (subtle at the aerial default) but the gating mechanism is confirmed on the canyon. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_079b093a-c189-4d4f-8eb5-f4661acd1c69) |
📝 WalkthroughWalkthroughThis PR extends the terrain vertex shader in GeoHelix.tsx with GLSL value-noise functions to generate drifting cloud shadows, adds specular-like highlights for water and snow, lowers the terrain exaggeration cap to 4.2, and throttles uTime updates to drive cloud animation only for terrain scenes. ChangesTerrain Cloud Shadows and Rendering Adjustments
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cockpit/src/GeoHelix.tsx (1)
657-666: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCap logic is correct; the preceding comment block is now stale.
Math.min(EXAG_CAP, Math.max(1.5, 0.11 / span))correctly clamps to[1.5, 4.2], and the drape lift at Line 690 reusesuExagVal, so the cap propagates consistently. However, the unchanged comment just above (Lines 652-653) still claims a "consistent vertical presence (~0.11 of the frame) regardless of its true-scale span" and "Iceland … → ~15 (matches the hand-tuned value)". With the 4.2× cap, Iceland now lands at ~4.2×0.0067 ≈ 0.028 of the frame, so both the "~0.11 regardless of span" invariant and the "~15" figure are no longer accurate. Please refresh that comment so the rationale matches the new cap.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cockpit/src/GeoHelix.tsx` around lines 657 - 666, Update the stale explanatory comment in GeoHelix.tsx near the EXAG_CAP and uExagVal logic so it matches the current clamp behavior. The comment should no longer claim a fixed ~0.11 frame presence or ~15x exaggeration for Iceland; instead, describe that the terrain exaggeration is now capped at 4.2x via Math.min(EXAG_CAP, Math.max(1.5, 0.11 / span)) and that uExagVal is reused consistently for the drape lift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cockpit/src/GeoHelix.tsx`:
- Around line 657-666: Update the stale explanatory comment in GeoHelix.tsx near
the EXAG_CAP and uExagVal logic so it matches the current clamp behavior. The
comment should no longer claim a fixed ~0.11 frame presence or ~15x exaggeration
for Iceland; instead, describe that the terrain exaggeration is now capped at
4.2x via Math.min(EXAG_CAP, Math.max(1.5, 0.11 / span)) and that uExagVal is
reused consistently for the drape lift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ae7f6e4a-f41d-40fa-822b-d42b2a1c70f2
📒 Files selected for processing (1)
cockpit/src/GeoHelix.tsx
Fixes the
/garmin/icelandneedle field and adds atmosphere to the terrain scenes. Client-side only (GeoHelix.tsx) — no asset regeneration, no new parser. Two commits.1 — The needle field was over-exaggeration, not quantization
The "dequantize" framing turned out to be a misnomer. I decoded the live v8-grid and measured it:
So the height data is fine. The needles were the client's auto-exaggeration:
0.11/spandrives Iceland's tiny true-scale span (~0.0067) to ~16×, versus the canyon's 2.2× — and at 16× Iceland's genuinely rugged ~100 m fjord/ridge detail frays into needle-hair.Fix: cap the auto-exaggeration at 4.2×. Iceland clamps 16×→4.2× and reads as a clean island with real relief (mountains, glacier caps, fjords, highland valleys); the canyon (2.2×) sits below the cap so it is unchanged — verified by re-render (walls still read as walls, drape intact). No
.DEMreparse needed — rebaking from a different DEM source would have given the same rugged data.2 — Terrain atmosphere: drifting clouds + KIND-gated sun-glint / ice-sheen
The "Fresnel/specular for ice caps + waves" direction, layered on the crisp relief:
uTimedapples soft moving shade over the terrain (atmosphere + a real sense of scale). Terrain scenes redraw for the motion, throttled to ~15 fps so the continuous redraw of a heavy DEM stays cheap; anatomy/buildings stay fully on-demand (zero idle cost).aColor(not the hypsometric render): ocean (blue-dominant,[26,62,104]) → tight bright sun-glitter that brightens where clouds part; ice/snow (near-white,[238,244,252]) → broad soft sheen. The canyon's grey terrain KIND ([150,150,150]) triggers neither, so its hypsometric-white peaks stay matte — no false glacier shine.Verify
npx tsc --noEmit— clean.The third of the Garmin terrain arc (after #93 shader, #94 surfel, #95 drape).
🤖 Generated with Claude Code
https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
Generated by Claude Code
Summary by CodeRabbit