Closed
perf + lighting: PCFSoft shadows, fill light, tighter frustum, quality-tiered shadow maps#1
Conversation
Copilot
AI
changed the title
Improve Three.js scene performance, shadow quality and lighting
perf + lighting: PCFSoft shadows, fill light, tighter frustum, quality-tiered shadow maps
Jun 13, 2026
Copilot created this pull request from a session on behalf of
benjosua
June 13, 2026 11:27
View session
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.
The Three.js scene had a fixed-resolution shadow map regardless of quality tier, an oversized shadow frustum wasting texel density, only a single key light (flat-looking scene), and a per-frame fog/background update running unconditionally every tick.
Performance
WorldBackground.useFrame— was callingscene.background.set()+ fog updates every frame; the declarative JSX and existinguseEffectalready cover thisperformance.js) —shadowMapSize512 / 1024 / 2048 for low / medium / high; was hard-coded to 1024 for all tiersShadow quality
PCFSoftShadowMapon theCanvas— replaces default hard-edge PCF with soft penumbraeshadow-radius={2}on the key light — adds PCFSoft blur for smoother edgesLighting
#b8cfe8) directional from[-3, 5, -4]at intensity 0.55, opposite the warm key at[4.5, 7.5, 5.5]; gives side-face separation on paddles/net that was completely absent before; subtly reacts toarenaFx.heatandflashTUNING.lighting.fill/fillColorwith matching debug-panel controls in theLightingPostfolder