Enable logarithmic depth buffer on tier-1 GPUs#43
Open
benjaminleonard wants to merge 1 commit into
Open
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
logarithmicDepthBuffer: tierAtMountto the WebGL renderer config so it activates only on tier-1 devices.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.logarithmicDepthBufferdistributes precision more evenly across the depth range and is the textbook fix. The runtime cost is an extragl_FragDepthwrite per fragment, so it's gated ontierAtMount— 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
?quality=lowor similar), verify no visible regression.(Recreated after history rewrite removed commercial fonts from git history; supersedes #33.)