How I run 34 shader backgrounds on a single Framer homepage without crashing. Here’s how: Browser...How I run 34 shader backgrounds on a single Framer homepage without crashing. Here’s how: Browser...
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
How I run 34 shader backgrounds on a single Framer homepage without crashing. Here’s how:
Browsers have a hard limit on how many WebGL contexts you can run at once, usually 10 to 15 before things start freezing or the page just dies. That’s not a Framer thing, it’s a GPU safety net. So if you tried to give 34 shader backgrounds their own component, you’d hit the wall in seconds.
Here’s what I did inside Uneo to safely offer 34 presets (and keep switching instant):
1. One context, one canvas, 4 active programs
I cache all shader data upfront for the presets you can cycle through, then only compile and keep hot what’s really needed. That dropped my footprint from 26 separate shader instances down to just 4 active GPU programs. The rest are on standby, no extra contexts piling up, no limit hit.
2. Single massive shader file = instant switching
Putting everything into one huge code file felt challenging at first, but it makes cycling instant. Switching presets is just binding a different pre compiled fragment program and updating uniforms. No reload, no recompile, no stutter.
3. Toggle the cache off in production
The cache is great while you’re exploring, but once you pick a single shader for your site, you don’t need 33 extras sitting in memory. A simple property toggle turns the cache off so only your chosen shader compiles, your published site stays lean.
4. Removable lazy load with distance controls
I added an optional lazy-load system. You can tell the canvas to only initialize when the user scrolls within a specific distance, and destroy itself when they scroll far enough away. Great for keeping long pages snappy if the shader isn’t always in view.
No crashes, no context limits, and switching feels like flipping a switch.
Hope this helps someone hitting the same GPU limits. If you’ve found a different way to manage multiple shaders at scale, I’d genuinely love to hear it.
This is amazing Fawaz! 🚀 Ranked #18 in Framer's Marketing category is huge! Love how you turned a free SaaS template into visibility + commissions. That's smart product thinking. Can't wait to read the full case study, congrats on the momentum!
I designed Keel as a fintech website concept focused on presenting financial products through a clean layout, clear messaging, and a simple user experience.
I’ve also built the website in Framer. Check it out below!
🎨 Built with Framer: https://thekeel.site/
Congrats on the launch Nilkanth! Keel looks super clean — love how you kept the fintech messaging simple and focused. The "Take Control of Your Financial Future" hero with the app preview balances trust and clarity perfectly. Great job building it in Framer too!