Cursed radix sort built purely from fragment shader blits inside VRChat's Udon
Michael_Moroz_ · x · 2026-09-03
A developer implemented a fully working radix sort inside VRChat's Udon scripting environment, where compute shaders, atomics, and scatter writes are unavailable — every step runs as fragment shader blits.
Key design details:
- Keys are stored in a float2 texture as (original index, key bits), addressed in Morton order so a 2:1 rectangle behaves like a flat array
- Each pass handles 4 bits in three blits plus one mip generation, including the histogram step
On an RTX 5090, the author reports it's only 2x slower than a 32-bit CUDA radix sort — but only for ≤1M elements with 20-bit keys, where everything fits in cache; the advantage disappears at scale.
Related event: Developer Implements Radix Sort Using Only Fragment Shaders in VRChat(2 posts)→
More from Fun
- Another round of image relighting demos making the rounds — StephanSturges · 2026-09-03
- Grok Bot Called a 'Self-Guided Missile' for Canceling Impulse DTC Subscriptions — beffjezos · 2026-09-03
- Snow leopard's deadpan 'passport photo' is the internet's latest mood — zetalyrae · 2026-09-03
- Reporter's AI-accusation backfires: real man with cluttered houseplants mistaken for AI — gleech · 2026-09-03
- threejsconf e-badges greet nearby attendees over ESP-NOW, turning networking into a game — xiaohu · 2026-09-03
- "A third world country is any without an LLM in the top 10" quip goes viral — mgostIH · 2026-09-03