perf(client): render bloom pass at quarter resolution (~16× less fill)#30
Open
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
Open
perf(client): render bloom pass at quarter resolution (~16× less fill)#30RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
Conversation
The bloom pass (WhiteCoreBloomPass / UnrealBloomPass) is the most expensive post-processing step due to its multi-pass Gaussian blur chain. EffectComposer.setSize() currently pushes the full drawing- buffer resolution to every pass, so bloom runs its entire mip chain starting at full-res. After the composer resize, override the bloom pass size to quarter resolution (width >> 2, height >> 2). At 1080p this drops the bloom base from 1920×1080 to 480×270 — roughly a 16× reduction in fragment fill. Because bloom is inherently a soft, blurry glow effect the visual difference is negligible while the GPU savings are substantial. Made-with: Cursor
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
The bloom pass (
WhiteCoreBloomPass, extending Three.jsUnrealBloomPass) is the single most expensive post-processing step. It runs a multi-pass Gaussian blur across a mip chain, and currently operates at full drawing-buffer resolution becauseEffectComposer.setSize()pushes the same width/height to every pass.This PR adds one line after the composer resize to override the bloom pass to quarter resolution:
Impact
The entire mip chain scales down proportionally, so total fragment work across all blur passes drops dramatically.
Why this is safe
Bloom is inherently a soft, blurry glow effect — its purpose is to spread bright highlights across neighboring pixels. At quarter resolution the individual bloom texels are still much smaller than the blur kernel, so the visual result is virtually indistinguishable from full-res bloom. Using
>> 2(bitwise divide by 4) maintains the screen's aspect ratio, avoiding any bloom distortion.Changes
client/src/core/Renderer.tsthis._bloomPass.setSize(vec2.width >> 2, vec2.height >> 2)after composer resizeTest Plan
_resizePostProcessing)setSizecall is harmless when the pass is inactive