Skip to main content
Zubin KhavarianZubin Khavarian

Writing / series

Three.js at 60 fps

Keeping three.js games smooth on school Chromebooks: first-draw stutter, draw calls and asset size. 3 parts, 2 out so far.

  1. Part 1

    Your Shader Stutter Happens at First Draw

    8 min read

    A three.js hitch the first time an effect appears is usually a WebGL program link. It blocks at the first draw, not at compile, and a warm-up only fixes it if it links the same program variant your frames use.

  2. Part 2

    Hundreds of Draw Calls Down to a Handful with BatchedMesh

    7 min read

    How Typo's Voyage draws every tile and every 3D letter through four three.js BatchedMeshes, poses a whole treadmill on the GPU with one vec4 a frame, and what breaks when you move instances in the vertex shader.

  3. Part 3 · ships

Follow this series by RSSAll writing

zubin@zubin.dev: man keys

// go to

  • ghhome
  • gwwriting
  • gaapps
  • gpprojects
  • goopen source
  • gnnow
  • guuses

// move

  • jscroll down
  • kscroll up
  • ggtop of page
  • Gbottom of page
  • }next section (posts)
  • {previous section (posts)
  • ]newer post
  • [older post

// do

  • ⌘Ksearch everything
  • /search, too
  • ttoggle light / dark
  • ?this sheet
  • escclose