Skip to content

fix(hands): keep the picture when the resolution scaler reaches its bottom tier - #297

Merged
user1303836 merged 2 commits into
mainfrom
fix/hands-low-tier-blank
Nov 17, 2026
Merged

user1303836 merged 2 commits into
mainfrom
fix/hands-low-tier-blank

Conversation

@user1303836

Copy link
Copy Markdown
Owner

Summary

On a client slow or busy enough for the dynamic resolution scaler to reach its bottom tier, the whole lit scene stopped drawing: the ring, the crowd and both fighters vanished and only the backdrop and the HUD were left. The console filled with GL_INVALID_OPERATION: glDrawElements: Mismatch between texture format and sampler type.

Cause

At the low tier setKeyShadowTier disposed the key light's shadow map and left it null while castShadow stayed on (so that no program is recompiled). With no map, three 0.186 binds its stand-in depth texture to the sampler2DShadow array without setting a comparison function, and ANGLE refuses every draw that samples it.

Fix

The shadow map is never left null: turned off, it is swapped for a 16 pixel map that is drawn once and kept. The large depth target is still freed and castShadow is still untouched, so nothing is recompiled.

Verification

  • Reproduced on main in Chromium (ANGLE Metal) with ?fixture=1 and r=__fixtureRenderer; r.scaler.record=()=>false; r.scaler.scale=0.55; r.applyResolutionScale(): empty arena and the GL error flood. With the fix the same steps draw the whole scene with no console errors or warnings.
  • renderer-gpu.test.ts now pins that a live depth target is bound after every frame through repeated down and up tier changes, that the large one is freed, that the small one is drawn once and kept, and that no program is compiled.
  • npm run typecheck, npm run build, npm run scan:build, npm run audit:high pass. The GPU, gore, pose and injury-pose test files pass locally; the whole suite is left to CI because this machine is under load.

…ottom tier

- At the low tier the key light's shadow map was disposed and left null. three then binds a stand-in
  depth texture with no comparison function to the shadow sampler, which ANGLE refuses, so every lit
  mesh (ring, crowd, fighters) stopped drawing on a slow or busy client.
- The shadow map is now swapped for a 16 pixel one drawn once, never left null; castShadow is still
  untouched, so no program is recompiled.
@user1303836
user1303836 merged commit b36c0e7 into main Nov 17, 2026
6 checks passed
@user1303836
user1303836 deleted the fix/hands-low-tier-blank branch November 17, 2026 06:30
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