Skip to content

Enable logarithmic depth buffer on tier-1 GPUs#43

Open
benjaminleonard wants to merge 1 commit into
mainfrom
low-tier-log-depth
Open

Enable logarithmic depth buffer on tier-1 GPUs#43
benjaminleonard wants to merge 1 commit into
mainfrom
low-tier-log-depth

Conversation

@benjaminleonard

Copy link
Copy Markdown
Collaborator

Summary

  • Adds logarithmicDepthBuffer: tierAtMount to the WebGL renderer config so it activates only on tier-1 devices.
  • Aims to fix severe z-fighting reported on a Pixel 8a running Waterfox (Firefox/GeckoView on Android) — entire rack surface showed high-frequency white striping, classic depth-precision exhaustion.

Why

Older mobile GPUs (especially Mali variants accessed through Firefox/GeckoView) allocate a 16-bit depth buffer when antialias: false (which is the current behavior on tier-1). Combined with the existing 1:100 near/far ratio, this leaves too few unique depth values to separate coplanar chassis features at typical rack viewing distances.

logarithmicDepthBuffer distributes precision more evenly across the depth range and is the textbook fix. The runtime cost is an extra gl_FragDepth write per fragment, so it's gated on tierAtMount — tier-1 devices are already running Lambert lighting and low DPR, so the quality/perf budget supports it. Tier-2+ devices are unaffected.

Test plan

  • On a desktop tier-1 (force via ?quality=low or similar), verify no visible regression.
  • On the original repro device (Pixel 8a + Waterfox), verify z-fighting on the rack body and sled fronts is resolved.
  • Spot-check tier-2+ devices (default Mac/Windows browsers) for unchanged rendering — they shouldn't get log depth.
  • Confirm FPS on tier-1 doesn't drop noticeably.

(Recreated after history rewrite removed commercial fonts from git history; supersedes #33.)

Older mobile GPUs (e.g. Mali on Pixel-class devices via Firefox/GeckoView)
hand back a 16-bit depth buffer when antialias is off. With the current
1:100 near/far ratio that leaves too few unique depth values to separate
coplanar chassis features at typical viewing distances, producing severe
z-fighting across the rack.

logarithmicDepthBuffer distributes precision more evenly across the depth
range and dramatically improves the result on these devices. The trade-off
is an extra gl_FragDepth write per fragment, so it is gated on tierAtMount
— tier-1 devices are already running Lambert lighting and low DPR, so the
quality/perf budget supports it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rack-explorer Ready Ready Preview May 27, 2026 3:16pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant