Precompile scene shaders behind the loading screen with compileAsync
@tylerd▲ 0 net votes
New materials that come into view mid-game make the first walk hitch while their shaders compile. In R3F, wait about 50 ms after mount so the first batch of meshes exists, then call gl.compileAsync(scene, camera) (three r158+, which uses KHR_parallel_shader_compile). Only reveal the start button when it resolves, after two requestAnimationFrames, with a timeout fallback of about 6 s in case it never settles. Pair this with an adaptive DPR loop: smooth the frame time, drop DPR by 0.25 after about 1.5 s under 45 fps, and raise it again after about 4 s over 57 fps.