switch 🏴
banner
switch161.bsky.social
switch 🏴
@switch161.bsky.social
programmer, anti-fascist, and more :3
they/them, german/english
Roast my texture atlas.

I did eventually grasp how to manipulate UVs to make stuff look crisp and not too distorted.
February 11, 2026 at 10:37 PM
The shoes look garbage, but I'm happy with the rest. Next I'm gonna animate her.
February 11, 2026 at 10:31 PM
Let's try again with a GIF
February 11, 2026 at 10:05 AM
This was supposed to be animated (spinning). I converted the rendered video to webp and it was working in Bluesky's preview. But now it's now 🤔
February 11, 2026 at 10:03 AM
I got textures to work.

At the moment I want to try some other new wgpu features - unrelated to this software renderer. But I'll try to work on this regularly, as I want to eventually make a proper release.
January 7, 2026 at 5:17 PM
Not sure if this will turn out to be a viable rendering backend. But it's a good learning experience and I think the software renderer or the JIT compiler alone can be great for testing and debugging (e.g. you can set breakpoints in your shaders).
December 31, 2025 at 5:21 AM
Performance: The teapot rendering took 20 ms (release build on a i7-8565U), but the fragment shader for it is very simple. Filling pixels takes the most time, so I need to try more complex shading to get a more representative result. I have a PBR shader lying around that I want to try at some point.
December 31, 2025 at 5:17 AM
Textures will be next. They already exist (we're rendering to one), but the shader runtime needs to expose a few builtin functions to allow the shader program to sample from them.
December 31, 2025 at 5:17 AM
A list of what works right now: depth buffers, vertex buffers, index buffers, clipping, culling, point/line/tri topology as either list or strip, interstage variables with no or linear interpolation, uniform buffers, surfaces.
December 31, 2025 at 5:17 AM
Then I picked up cranelift and wrote a JIT compiler to compile naga IR to x86_64 (or aarch64 and a few others). It was a lot of work but relatively straightforward. There's still a lot of language features missing and I want to refactor SIMD support, but overall I'm happy with it.
December 31, 2025 at 5:17 AM
Of course there's the little detail of actually running WGSL shader programs. Fortunately there's naga, which is a shader language IR and transpiler.

My first attempt was to interpret the naga IR, but it turned out to be not very elegant and probably way too slow.
December 31, 2025 at 5:17 AM
As mentioned my aim was to make it compatible with wgpu, so you can just use it like any other wgpu backend.

I'd almost call it straightforward to implement: You just write a triangle/line rasterizer and bam. Well almost.
December 31, 2025 at 5:17 AM
So SSTV stands for Slow Scan Television, which is a mode to transmit still images via radio, used by amateur radio operators. It encodes the pixels and a header using frequency modulation, meaning the signals in the picture are just detections of tones of different frequencies.
July 26, 2025 at 8:53 PM
AM radio is really simple. All you gotta do is multiply the radio signal with e^(-i*2*pi*f*t) to shift the frequency of the station to 0. Then lowpass filter (remove high unwanted frequencies) and decimate (drop samples to downsample to audio sample rate). That's it! Multiply and average.
July 16, 2025 at 7:36 AM
I remembered that I have a book about signal processing! With it, wikipedia and youtube all this stuff starts to make a lot of sense now!

I just got a crude AM radio receiver working 📻 🎶
July 16, 2025 at 7:36 AM
It does make sense now. The FFT outputs the complex amplitudes for frequencies f = omega / (2 * pi * T). So for the right half the complex amplitudes are just rotating with >pi/T in the opposite direction. So those are the frequencies left of the center frequency.
July 12, 2025 at 6:20 PM
Oh my goddess! I just realized the big mistake that made it look all wrong. When you do FFT you'll get first the right and then the left half of the spectrum.

The rustfft doc clearly states that it would be ordered with ascending frequency.

But my output matches SDR++ now 😀
July 12, 2025 at 6:07 AM
Fortunately my rust replacement for rtl_tcp allows multiple client connections, so I can connect my TUI app and SDR++ to it at the same time and compare them.

Unfortunately they don't match that well. Some of my math isn't mathing correctly ☹️
July 11, 2025 at 12:51 AM
I've added a little indicator that displays the frequency of your mouse position.

If I'm not mistaken (I'd have to look with a proper app like SDR++) this red stripe at 7.1 MHz is that russian over-the-horizon radar that is always on at night at that frequency.
July 11, 2025 at 12:31 AM
Hmm, stupid me. If I only need low-resolution spectra, I can just downsample the input signal, no?
July 10, 2025 at 6:17 PM
I also want to do the FFT on larger buffers to increase resolution in frequency space. For one I could then display smaller sections of the spectrum. But I also want to be able to select small frequency bands and demodulate them.
July 10, 2025 at 5:52 PM