fix(shader): reduce specular aliasing on envAtlas reflections#8955
Open
willeastcott wants to merge 2 commits into
Open
fix(shader): reduce specular aliasing on envAtlas reflections#8955willeastcott wants to merge 2 commits into
willeastcott wants to merge 2 commits into
Conversation
The envAtlas reflection chunk only applied screen-space derivative antialiasing (shinyMipLevel) for near-mirror surfaces (ilevel == 0). All rougher materials selected the reflection mip from material gloss alone, ignoring screen-space minification, so curved/minified glossy surfaces aliased badly. Fold the screen-space minification level into the roughness level via max(level, shinyMipLevel(...)) before flooring, so reflections blur to track minification at all gloss levels. Applied to both the GLSL and WGSL chunks for backend parity. Fixes #8431 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Build size reportThis PR changes the size of the minified bundles.
|
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.
Description
The envAtlas reflection chunk only applied screen-space derivative antialiasing (
shinyMipLevel) for near-mirror surfaces (ilevel == 0). All rougher materials selected the reflection mip from material gloss alone, ignoring screen-space minification, so curved/minified glossy surfaces aliased badly — a regression from the pre-v1.51 prefiltered-cubemap pipeline.This folds the screen-space minification level into the roughness level via
level = max(level, shinyMipLevel(...))before flooring, so reflections blur to track minification at all gloss levels. The change is monotonic (blur never decreases), so it cannot introduce new aliasing. Applied to both the GLSL and WGSL chunks for backend parity.Tradeoff: distant near-mirror surfaces are very slightly softer under minification (the "shiny" atlas mip pyramid is bypassed), which matches the smoother pre-v1.51 look.
Fixes #8431
Before / after
Reporter's project rendered against this branch (engine source, identical camera). Note the embossed sheet-metal panel and the drum rim — the broken/sparkly specular highlights become smooth and continuous:
main)Checklist