Skip to content

perf(client): render bloom pass at quarter resolution (~16× less fill)#30

Open
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:perf/bloom-quarter-resolution
Open

perf(client): render bloom pass at quarter resolution (~16× less fill)#30
RZDESIGN wants to merge 1 commit intohytopiagg:mainfrom
RZDESIGN:perf/bloom-quarter-resolution

Conversation

@RZDESIGN
Copy link
Copy Markdown

@RZDESIGN RZDESIGN commented Mar 5, 2026

Summary

The bloom pass (WhiteCoreBloomPass, extending Three.js UnrealBloomPass) 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 because EffectComposer.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:

this._bloomPass.setSize(vec2.width >> 2, vec2.height >> 2);

Impact

Display Before (bloom base) After (bloom base) Fill reduction
1080p 1920 × 1080 480 × 270 ~16×
1440p 2560 × 1440 640 × 360 ~16×
720p 1280 × 720 320 × 180 ~16×

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

File Change
client/src/core/Renderer.ts Added this._bloomPass.setSize(vec2.width >> 2, vec2.height >> 2) after composer resize

Test Plan

  • Compare bloom appearance at 1080p before and after — glow around emissive blocks / entities should look identical
  • Check GPU frame time in the debug panel — expect a measurable drop, especially on integrated GPUs
  • Resize the browser window and verify bloom still looks correct (resize handler calls _resizePostProcessing)
  • Verify on LOW/MEDIUM quality presets where bloom may be disabled — the setSize call is harmless when the pass is inactive

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
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