Litmus Universe

Performance · WebGL · Accessibility

The Weight of a Frame: A Performance Budget for WebGL

Litmus Universe9 min read

At sixty frames per second, you have about 16.7 milliseconds to build a frame — and your browser needs some of that too. Everything that makes a 3D experience feel alive has to fit inside that sliver of time, sixty times a second, on a phone someone bought four years ago.

It's easy to make a WebGL scene that's stunning on a workstation. It's hard to make one that's stunning on a mid-range Android with battery saver on. The gap between them is a performance budget — limits you decide before you fall in love with an effect.

Know where the milliseconds go

  • Draw calls. Every separate object has overhead. Merge geometry and instance ruthlessly.
  • Overdraw. Transparent, additive particles make the GPU shade the same pixel many times. Fullscreen blended clouds are where frame rates die.
  • Shader complexity. A fragment shader runs once per pixel — millions of times per frame. Move math to the vertex shader when you can.
  • Main-thread JavaScript. Rebuilding arrays and allocating every frame competes with rendering.
You don't optimize a scene by making everything faster. You optimize it by deciding what you're willing to not do.

Particle systems: spend your points wisely

  • One geometry, many points. One draw call for tens of thousands of particles.
  • Morph on the GPU. Interpolate two buffers in the vertex shader; only swap targets when the scene changes.
  • Scale to the device. Halve the count on mobile and cap the pixel ratio.

Reduced motion is a feature, not a fallback

Some visitors get motion sick; some are on a device that can't keep up; some told their OS they want less movement. Honoring prefers-reduced-motion is part of the design — the still version is its own beautiful poster. The same instinct keeps a real, semantic DOM under the canvas, which protects your SEO and first paint.

Want spectacle that stays fast?

We build immersive experiences engineered to hold their frame rate everywhere.

BUILD WITH US →

Keep reading

Vibe Coding: Shipping Software by Describing It → Designing for Zero Gravity: Spatial UX on the Open Web →

Performans · WebGL · Erişilebilirlik

Bir Karenin Ağırlığı: WebGL İçin Performans Bütçesi

Litmus Universe9 dk okuma

Saniyede altmış karede, bir kareyi kurmak için yaklaşık 16,7 milisaniyeniz var — üstelik tarayıcının da bundan payı lazım. Bir 3B deneyimi canlı hissettiren her şey, dört yıl önce alınmış bir telefonda, saniyede altmış kez, o küçücük zaman dilimine sığmak zorunda.

Bir iş istasyonunda nefes kesen bir WebGL sahnesi yapmak kolaydır. Pil tasarrufu açık, orta seviye bir Android'de nefes kesen bir sahne yapmak zordur. İkisi arasındaki fark bir performans bütçesidir — bir efekte âşık olmadan önce koyduğunuz sınırlar.

Milisaniyelerin nereye gittiğini bilin

  • Çizim çağrıları. Her ayrı nesnenin bir maliyeti vardır. Geometriyi birleştirin ve acımasızca instancing kullanın.
  • Aşırı çizim (overdraw). Saydam, toplamalı parçacıklar GPU'ya aynı pikseli defalarca boyatır. Tam ekran karışık bulutlar, kare hızının öldüğü yerdir.
  • Shader karmaşıklığı. Bir fragment shader piksel başına bir kez çalışır — karede milyonlarca kez. Mümkün olduğunda matematiği vertex shader'a taşıyın.
  • Ana iş parçacığındaki JavaScript. Her karede dizi yeniden kurmak ve bellek ayırmak, render ile yarışır.
Bir sahneyi her şeyi hızlandırarak optimize etmezsiniz. Neyi yapmaktan vazgeçeceğinize karar vererek optimize edersiniz.

Parçacık sistemleri: noktalarınızı akıllı harcayın

  • Tek geometri, çok nokta. On binlerce parçacık için tek bir çizim çağrısı.
  • GPU'da morph yapın. İki tamponu vertex shader'da geçişleyin; hedefleri yalnızca sahne değiştiğinde değiştirin.
  • Cihaza göre ölçekleyin. Mobilde sayıyı yarıya indirin ve piksel oranını sınırlayın.

Hareketi azaltmak bir yedek değil, bir özelliktir

Kimi ziyaretçi hareketten rahatsız olur; kimi yetişemeyen bir cihazdadır; kimi de işletim sistemine daha az hareket istediğini söylemiştir. prefers-reduced-motion'a uymak tasarımın bir parçasıdır — durağan sürüm kendi başına güzel bir afiştir. Aynı içgüdü, canvas'ın altında gerçek, anlamsal bir DOM tutar; bu da SEO'nuzu ve ilk boyamayı korur.

Hızlı kalan bir gösteri mi istiyorsunuz?

Her yerde kare hızını koruyacak şekilde mühendislenmiş sürükleyici deneyimler kuruyoruz.

BİZİMLE İNŞA EDİN →

Okumaya devam et

Vibe Coding: Anlatarak Yazılım Üretmek → Yerçekimsiz Tasarım: Açık Web'de Mekânsal UX →