Code Golfing a Tiny Demo Using Maths and a Pinch of Insanity
Posted3 months agoActive3 months ago
blog.pkh.meTechstory
excitedpositive
Debate
20/100
Code GolfingDemo CodingShader Programming
Key topics
Code Golfing
Demo Coding
Shader Programming
The post showcases an extremely compact demo coded using mathematical tricks and shader programming, with the community discussing its intricacies and suggesting optimizations.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
10h
Peak period
11
12-24h
Avg / period
4.4
Comment distribution22 data points
Loading chart...
Based on 22 loaded comments
Key moments
- 01Story posted
Sep 29, 2025 at 9:34 AM EDT
3 months ago
Step 01 - 02First comment
Sep 29, 2025 at 7:48 PM EDT
10h after posting
Step 02 - 03Peak activity
11 comments in 12-24h
Hottest window of the conversation
Step 03 - 04Latest activity
Oct 4, 2025 at 7:18 AM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45413588Type: storyLast synced: 11/20/2025, 8:52:00 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
> WARNING: Too many active WebGL contexts. Oldest context will be lost.
The code on the blog is pretty simple and naive (I'm not a webdev): https://github.com/ubitux/scripts/blob/main/share/blog/shade...
Any suggestion on how to address the issue is welcome.
Note: I don't have any Windows machine to test with
https://github.com/greggman/virtual-webgl
If you want to make your own solution there's one listed here about 1/2 way down the page
https://webglfundamentals.org/webgl/lessons/webgl-multiple-v...
As an aside, WebGPU doesn't have this issue or at least has it less. For one, WebGPU can use a single device to render to multiple canvases, something WebGL can't. Another is that WebGPU is mostly stateless making it easier for both the user and the browser.
What am I saying? Fine? It's freaking awesome.
If you see a way to make it shorter, feel free to share :)
But! You can save 1 char by replacing w with a:
So thank you for the idea!I added your changes to the Shadertoy version with your HN nickname. I'll integrate it to the original later.
Thanks!
It seems that leaving the obsession behind some more can save another byte.