A Series of Tricks and Techniques I Learned Doing Tiny Glsl Demos
Key topics
Diving into the mesmerizing world of tiny GLSL demos, one developer shares a treasure trove of tricks and techniques learned from crafting stunning visual effects. Commenters rave about the inspirational content, with some novices expressing eagerness to start experimenting with GLSL, while veterans appreciate the concise explanations and live examples. As the discussion unfolds, a debate emerges around code readability, with some praising the author's compact style and others suggesting that more documentation would be helpful. The thread is abuzz with enthusiasm, as developers from diverse backgrounds – from game makers to terminal enthusiasts – share their own experiences and interests in GLSL shaders.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
2h
Peak period
5
4-6h
Avg / period
2.9
Based on 26 loaded comments
Key moments
- 01Story posted
Dec 8, 2025 at 11:44 AM EST
25 days ago
Step 01 - 02First comment
Dec 8, 2025 at 1:59 PM EST
2h after posting
Step 02 - 03Peak activity
5 comments in 4-6h
Hottest window of the conversation
Step 03 - 04Latest activity
Dec 9, 2025 at 2:02 PM EST
24 days ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
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.
I started playing around with GLSL recently and the closest I have come to describing working with it is that it is like creating poetry using math. Getting started was much easier than I expected, getting good results is so far as hard as expected
I started 2-3 months ago or so doing this stuff, so don't be too intimidated to start. Especially with the two articles (Red Alp and this one), it should make it more accessible, hopefully :)
Only critique is.. if you're sharing to teach, your compact/one line [460] char GLSL code is a poor delivery mechanism.
I'm glad it reaches an audience :)
> Only critique is.. if you're sharing to teach, your compact/one line [460] char GLSL code is a poor delivery mechanism.
Understandable. Though, the demos are here to illustrate "what you can do with the trick I'm sharing". It's like, I'm teaching you how to do watercolor, and illustrate it with some paintings you won't be able to perform just with that knowledge. They're meant to inspire you to create. You're not looking at a tutorial, you're looking at art.
For once instead of being shoved a ready-made solution there's a short explanation of the core idea with a live example, but instead of a fully documented shadertoy it's like the answer is ROT13'd which makes me itch for implementing a solution myself.
What's a good way to get started learning to build/customize shaders with GLSL? I have an engineering math background but I was never the best at math. And GLSL syntax looks a bit tedious to be honest, but I'd love to dive in.
I gave some directions and resources in a comment here, it might help you: https://www.reddit.com/r/GraphicsProgramming/comments/1pgqis...
> And GLSL syntax looks a bit tedious to be honest, but I'd love to dive in.
With the vectorization everywhere, it's surprisingly convenient given how simple the syntax is. I personally just miss some sinpi/cospi/etc, and/or a PI and TAU constant.
That aside, i love the work, I just hate having to mentally grok the d and c style variables. As if number of chars minimum is the goal. Number of instructions yes, but we can do better than d and t.
Moonlight is beautiful.
My theory is that graphics programmers, at some point, stop having to care very much about what the textual representation of their program actually looks like. Because graphics programming is so hard, once you get to the point of understanding what you're doing, and typing in the shader, it becomes self-explanatory; you don't actually need variable names, what you need is understanding.
Inigo Quilez (author of shadertoy, and graphics programming legend) is one of the most talented graphics programmers alive, and produces some of the least readable code I've ever seen.
Just my 2c on why this is so common in graphics, specifically
Using more readable names definitely helps during development. I think the cause of this is twofold.
First, there's a lot of equations used in graphics programming where the canonical names of variables are single letters. If you know the formula a single letter is a good name and it is expected that others reading it also understand it - if you didn't you'd have to read up on the formula anyway.
But beyond that I also think it's a bit of misguided pride. Thinking it's cool to have as minimal inscrutable shader code as possible because that's trendy. It's very common for shaders to be developed with reasonable names and good layout then rewritten before publishing like it was an IOCCC entry.
That's what I was getting at in my comment. A lot of the shader code I encounter is pretty math-y.
The rest I'm not too sure about .. I don't come across a lot of shaders that are code-golf-y trying to optimize for least number of bytes, but, then again, the article did just that .. so .. :shrug:
For my tastes this is excessive (especially since the formatting is non-existent), but you do pay a cost for longer variable names. There's only so much you can grok when reading a passage, and long names hinder any higher-level understanding of what that passage actually does, requiring you to resort to carefully thinking about the problem rather than any shortcuts and insights your powerful visual cortex might provide.
Since you had to record and upload the GIFs yourself (which to be fair was easy with PICO-8), I spent a month or so writing a Twitter bot to automatically respond to the Lua programs with a GIF of them running [4]. I was extremely proud of my shoddy little bot (that used Python, bash scripts, and a LXD container inside another LXD container, IIRC). Crazy coincidence: I released it just hours before someone else was to release their Twitter bot that did the same thing [5], despite this niche being unfilled for years and neither of us knowing of each other. His was better architected, and we kept in touch for a while.
1. https://twitter.com/search?q=%23tweetcart
2. https://mastodon.gamedev.place/@Pico8TweetCarts
3. https://www.lexaloffle.com/bbs/superblog.php?mode=gifs&cat=0...
4. https://x.com/auto_tweetcart
5. https://x.com/tweetcartrunner
This is the kind of stuff I always feel I should be able to do, yet it never happened. Seeing others just do it and share their learnings is such a joy.