{"id":121,"date":"2026-05-15T09:00:00","date_gmt":"2026-05-15T09:00:00","guid":{"rendered":"https:\/\/byteflows.net\/wp\/aurem\/three-js-without-the-headache-our-production-setup\/"},"modified":"2026-05-15T09:00:00","modified_gmt":"2026-05-15T09:00:00","slug":"three-js-without-the-headache-our-production-setup","status":"publish","type":"post","link":"https:\/\/brandy.digital-blessings.xyz\/?p=121","title":{"rendered":"Three.js without the headache: our production setup"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WebGL scenes have a reputation for being beautiful demos and painful products. After shipping a dozen of them to real clients, we settled on a setup that keeps the beauty and removes most of the pain.<\/p>\n\n\n\n<h2 class=\"\\&quot;wp-block-heading\\&quot; wp-block-heading\">Content first, scene second<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The page renders and becomes usable without the 3D layer. Three.js loads afterwards, deferred, and the canvas fades in when the first frame is ready. If WebGL is unavailable, a designed fallback image takes its place.<\/p>\n\n\n\n<h2 class=\"\\&quot;wp-block-heading\\&quot; wp-block-heading\">Our budgets<\/h2>\n\n\n\n<ul class=\"\\&quot;wp-block-list\\&quot; wp-block-list\">\n<li>Under 150 KB of compressed JavaScript for the scene.<\/li>\n\n<li>Pixel ratio capped at 1.5 \u2014 sharp enough, half the GPU work of 3\u00d7.<\/li>\n\n<li>60 fps on a three-year-old mid-range phone, or the effect is simplified.<\/li>\n\n<li>The render loop pauses when the canvas leaves the screen.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"\\&quot;wp-block-heading\\&quot; wp-block-heading\">Shaders over models<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Where we can, we draw with shaders instead of loading heavy models. A full-screen fragment shader can produce a living, brand-coloured backdrop in a few kilobytes \u2014 the \\&#8221;molten silk\\&#8221; on our own homepage is one of them.<\/p>\n\n\n\n<blockquote class=\"\\&quot;wp-block-quote\\&quot; is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">The best WebGL is the kind visitors feel before they notice.<\/p>\n<cite>Lucas Brandt, Creative Developer<\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Loading, fallbacks, performance budgets and mobile GPUs. The starter we use to ship WebGL that works everywhere.<\/p>\n","protected":false},"author":1,"featured_media":122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[29,37,39],"class_list":["post-121","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-performance","tag-three-js","tag-webgl"],"_links":{"self":[{"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":0,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=\/wp\/v2\/media\/122"}],"wp:attachment":[{"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brandy.digital-blessings.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}