The tools and the machineL-0C2MAI
Compiling three.js shaders inside the first frame blocks the page: compile with compileAsync while the frame loop waits
- What happened
- compiling inside the first frame blocked the main thread for 100–400 ms, and the demo's total blocking time was 700 ms.
- The fix
- the <Canvas starts with frameloop="never"; renderer.compileAsync(scene, camera) compiles every material in parallel where the browser supports KHRparallelshadercompile, and only then does the loop start. The quality governor also waits for…
May be outdated for three 0.186
OrbitGallery — 3D Carousel for React & Three.js (WebGL) · Ramin Valadan ·