M
Mecheye
blog.mecheye.net · Personal blog · on HN since 2012
Mecheye is a developer's blog on graphics, Linux display stack internals, game rendering techniques, and web APIs.
What HN saysHN commenters value its explanations of the Linux graphics stack and DRI, and its Web Audio API critique; the author comments there too.
46HN people shared it
19linked it in comments
37stories submitted
2.3Kstory points
1 year agolast shared
2012people per year2026
Most-shared posts
- 1The Linux Graphics Stack11 people · 351 points · first shared 2012 · 38 comments on HN
- 2Deconstructing the Water Effect in Super Mario Sunshine7 people · 320 points · first shared 2018 · 29 comments on HN
- 3I don’t know who the Web Audio API is designed for6 people · 390 points · first shared 2017 · 178 comments on HN
- 4Why are 2D vector graphics so much harder than 3D?4 people · 482 points · first shared 2019 · 85 comments on HN
- 5Bytecode4 people · 130 points · first shared 2012 · 36 comments on HN
- 6“DRI”4 people · 2 points · first shared 2016 · discussion on HN
- 7Xwayland3 people · 57 points · first shared 2014 · 15 comments on HN
- 8Introduction to HTML Components2 people · 285 points · first shared 2017 · 143 comments on HN
- 9URG2 people · 124 points · first shared 2017 · 11 comments on HN
- 10Why I’m excited for Vulkan2 people · 29 points · first shared 2015 · 3 comments on HN
- 11The Missing Guide to Modern Graphics APIs – 1. Intro2 people · 4 points · first shared 2020 · discussion on HN
- 12Gnome developer creates new animated image format1 people · 88 points · first shared 2014 · 36 comments on HN
- 13Why Package Managers Are Not My Ideal Software Distribution Mechanism1 people · 18 points · first shared 2014 · 4 comments on HN
- 14The Linux Graphics Stack (2012)1 people · 12 points · first shared 2015 · discussion on HN
- 15Shellshock will happen again1 people · 4 points · first shared 2014 · discussion on HN
What HN people wrote when they linked it
sleepydog · 2020-05-05
I really enjoy reading about some of the techniques the developers use to get the most out of the hardware. Here are some of my favorites from recent memory:
https://medium.com/@gordonnl/wind-waker-graphics-analysis-a0b575a31127
https://blog.mecheye.net/2018/03/deconstructing-the-water-effect-in-su…
https://dolphin-emu.org/blog/2014/03/15/pixel-processing-problems/
Jasper_ · 2019-09-22
Author here.
I had been working on Linux professionally for about 6 years at that point, and got burned out on it. I have a lot of thoughts on the success of Linux as a general-use platform but mostly keep them to myself these days.
I still have a deep love for graphics, and have since moved onto working in the games industry, where I am much happier. I also still have a passion for explaining graphics topics.
Current efforts:
https://noclip.website/
https://blog.mecheye.net/2018/03/deconstructing-the-water-effect-in-su…
https://www.youtube.com/watch?v=8rCRsOLiO7k
Anthony-G · 2016-07-05
Thanks for the informative link on the technologies that comprise the graphics stack on a typical GNU/Linux system. I see the author also has a great explanation of the different code components that form part of the Direct Rendering Infrastructure (DRI): http://blog.mecheye.net/2016/01/dri/
raphlinus · 2023-01-09
I would say the most likely reason is that 2D graphics is just plain hard. Jasper's classic essay[1] goes into more detail.
That said, I'd really love to see more stuff along the lines of what you describe. I think Vello could render, for example, something that visually looks like Mini Metro or Mini Motorways. I also of course would be a massive fan of using Euler spirals - the only curve that's truly, really simpler is quadratic Béziers, and making those look good in your application would be hard. I'm about to do a lot of Euler spiral math on GPU as part of the stroke rework, which you may find interesting.
Strokes are easier for GPUs than fills, because you don't have to worry about the winding number issues (non-convex paths, paths with holes, etc). There are two recent papers, Polar Stroking[2] and Converting stroked primitives to filled primitives[3].
Also check out Freya Holmér's excellent Shapes library[4] (easily integrated with Unity).
Tesselating curves via shaders is the future (through mesh shaders in particular), and I've got a colleague working on that, but portable infrastructure seems to me just as thorny a problem as compute. I am very biased, but if it were me I'd try to render the 2D stuff with a 2D renderer like Vello.
Best of luck with your project, and I'd be interested in following the progress. Feel free to stop by the Zulip[5] and ask such questions there, as well.
[1]:…
boomlinde · 2019-11-11
Reminds me of the audio API mess. If you want to stream arbitrary sample data to an output you can either use ScriptProcessorNode (simple API, well supported but deprecated) or AudioWorkletNode (over-engineered API, largely unsupported and experimental).
The stall in that case seems caused by the overly ambitious design of the Web Audio API altogether. It's utterly useless for audio processing or synthesis except when using the aforementioned APIs because it mandates a bunch of underspecified high level concepts. Just let me fill a buffer with floats for the speakers and read a buffer of floats for the mic. That's literally all I need, and literally the only way you can build, say, a compressor and have full control of its characteristics.
When researching the best option I found this, so I'm not alone in thinking this: https://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-…
eropple · 2016-07-05
I would suggest reading (and comprehending) this excellent post for a review as to some of the tire-fire issues of X: http://blog.mecheye.net/2012/06/the-linux-graphics-stack/
DRI2 is an improvement over DRI, of course (which was already about five to eight years behind SOTA for GPUs when it came out), but it's still a rickety, insecure mess--for one, any application can fire messages at any window in the X environment and read input sent to any window, which has some obvious implications for the usefulness of containers on the desktop--that is sorely in need of replacement. This isn't to criticize X when it was developed, mind you--it was fine then. It should have been defenestrated by 2002.
Full disclosure: I get the feeling from your posts that you're looking to win an argument, rather than learn anything, so I'm not likely to respond to you further unless your tone changes. HTH. HAND.
mikepurvis · 2022-09-26
I've always been kind of fascinated by the state of GPUs immediately prior to fully-programmable shaders becoming the norm. It particularly comes up in the world of emulation, where often those weird fixed-function pipelines were abused in interesting ways to produce particular effects, and now someone has to figure out how to write a shader for a modern GPU that can perfectly replicate what that old pipeline block used to do, including all the edge-cases around overflow, saturation, and so on.
Unfortunately the inline demos seem to now be broken, but I found this article a fascinating treatise on how Gamecube and Wii games do things like render water:
https://blog.mecheye.net/2018/03/deconstructing-the-water-effect-in-su…
karanbhangui · 2021-12-31
This is an interesting read from their site: https://blog.mecheye.net/2020/06/modern-graphics-apis-1-intro/
leeoniya · 2020-05-10
you may find this interesting:
"Why are 2D vector graphics so much harder than 3D?"
https://blog.mecheye.net/2019/05/why-is-2d-graphics-is-harder-than-3d-…
bscphil · 2019-09-23
The examples in this link don't work for me in the latest Firefox or Chromium (or Brave) on Linux. https://blog.mecheye.net/2018/03/deconstructing-the-water-effect-in-su…
Edit: neither does anything here: https://noclip.website/
the_why_of_y · 2019-09-22
Xwayland doesn't need a hardware specific DDX driver, because firstly, many of the features can be implemented by forwarding to the Wayland server, and secondly, the drawing operations (which don't exist in Wayland) have been implemented hardware independently, based on OpenGL, in the GLAMOR backend.
https://blog.mecheye.net/2014/04/xwayland/
https://wayland.freedesktop.org/docs/html/ch05.html
If hardware vendors don't have to care about it, then Xwayland should not create a huge maintenance burden and thus I'm pretty confident it will be available until 2030; enterprise distros likely won't be able to remove it earlier anyway.
shmerl · 2017-08-30
I saw one brief overview here: http://blog.mecheye.net/2012/06/the-linux-graphics-stack/
exDM69 · 2016-05-12
Here's a good writeup from a few years ago about the Linux graphics stack internals:
http://blog.mecheye.net/2012/06/the-linux-graphics-stack/
chubot · 2014-06-08
You may want to read this (long) article:
http://blog.mecheye.net/2012/06/the-linux-graphics-stack/
Not claiming I understand it all, but it's long because graphics are complicated :) I have been surprised at how device-dependent graphics software is.
I wonder if Windows or OS X has nicer graphics abstractions than Linux? i.e. that make it less of a mess?
Spittie · 2014-04-06
A very interesting blog post about this: http://blog.mecheye.net/2014/04/xwayland/
It seems to explain many questions that where posted here the last time this was submitted.
flohofwoe · 2025-09-18
Audio worklets are a step into the right direction for streaming audio, but for a simple audio-streaming API you don't need the complex node-based architecture of WebAudio, you just need a JS callback which writes samples into an ArrayBuffer.
With audio worklets this callbacks runs in a separate audio thread, and with the (deprecated) ScriptProcessNode this callback runs on the main thread.
E.g. a "good" web audio API replacement would only offer a callback that runs in a separate audio thread plus a convenience function call which allows to push small sample-packets from the main thread to the audio thread (at the cost of increased latency to avoid starving) - this push-function would basically be the replacement for ScriptProcessorNode.
In general, see here for a pretty good overview why WebAudio as a whole is a badly designed API: https://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-…
TL;DR: WebAudio's original design requires a lot of complexity and implementation effort for use cases that are not relevant to most of its users - and all that effort could be used instead to implement a much smaller and focused web audio API that covers actually relevant use cases.
Specifically for audio worklets: those mainly make sense when the entire audio stream generation can happen on the audio thread.
But if you need to generate audio on the main thread (such as in emulators: https://floooh.github.io/tiny8bit/), unless you want to run the entire…
NavinF · 2023-08-04
You know what I meant by "infinite resolution". Today's monitors are nowhere close to retina (human eye resolution) and even further from being diffraction limited (the color frequency stuff you're talking about)
> If the monitors resolution and the font resolution were identical
Fonts are typically infinite resolution because they are small programs that you execute. Also see https://blog.mecheye.net/2012/12/bytecode/
> The brain processes sound logarithmically. Is the same true for vision?
If you're talking about brightness, it's a cube-root curve: https://en.wikipedia.org/wiki/Lightness#Relationship_to_value_and_rela…
> I watch movies at 24 frames per second, and yet, I'm usually incapable of perceiving this
Film projectors flash the same image multiple times because humans can easily notice 24fps. The lamp flickers and that's why movies are called "flicks". Good monitors flash each frame for only 1ms for the same reason: https://blurbusters.com/faq/motion-blur-reduction/
Try the UFO test: https://www.testufo.com/. If you genuinely can't see the difference between 30/60/120 Hz, you should get an eye exam because that's not normal.
dmitriid · 2020-01-09
I wouldn't count on any other browser to be anywhere onboard with that. Chrome is known for implementing things in a quick and dirty way with complete disregard for input.
Also, Fugu will definitely no bring a signinficant amount of native APIs to the web. Here's the full list [1]
For example, the post I'm replying to mentioned Ableton. Well "I don’t know who the Web Audio API is designed for" [2] Oh, and then there's no guarantee Chrome will not break it the way it broke automatic audio previously [3]
The web is not the long-term future for any foreseeable future
[1] https://bugs.chromium.org/p/chromium/issues/list?can=2&q=proj-fugu…
[2] https://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-…
[3] https://twitter.com/mcclure111/status/993627449991688193?ref_src=twsrc…
tomduncalf · 2017-10-17
This is exciting because it addresses one of the main complaints in the recent blog post http://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-d… which is that there's no way in WebAudio to just fill a buffer with numbers (samples) and have it play them back in real time (or to do the same, but processing an input buffer).
AudioWorklet (https://webaudio.github.io/web-audio-api/#AudioWorklet) allows you to create "processor" nodes, which have a "process" method which is called once per buffer, with any audio input to the node passed in as a parameter, and an output buffer to fill.
This should allow much more interesting and professional level audio generation and effects using WebAudio, and much easier porting of existing audio algorithms (as this is how most audio code, e.g. VST/AudioUnit plugins work), though I've not looked at the spec in detail yet or played with it, so the devil as always is in the details!.