Hacker News new | ask | show | jobs
by Jasper_ 2790 days ago
The DS "GPU" is indeed very bizarre and shares more in common with the GBA 2D rasterizer than a modern 3D GPU architecture. That it's a scanline renderer that can handle quads directly should be a pretty big tell :)

I implemented a cheap subset of it used in Super Mario 64 DS for my online model viewer ( https://noclip.website/#sm64ds/44;-517.89,899.85,1300.08,0.3... ), but implementing all of the quirks and the weird featuresets might be nearly impossible to do in a modern graphics API. 2D rasterizers don't have to be slow (as SwiftShader and ryg show), and you can get the bizarre conditions exactly correct. I'm not sure what a GPU-based implementation would even add.

EDIT: The math to be able to handle the bilinear quad interpolation on a GPU was worked out by reedbeta last year: http://reedbeta.com/blog/quadrilateral-interpolation-part-2/ . That's a big roadblock gone, but there's still a lot of other questionable things.

3 comments

Wow, that site is absolutely amazing. Fun seeing the great sea all at once! Do you write/blog about working on that?
I want to! I have a few articles I've written in the pipeline, but it's always a struggle to find a topic to write about. I did write this article about a very specific effect though: http://blog.mecheye.net/2018/03/deconstructing-the-water-eff...
Wow, I really like your website, I was blown away when I realized how many different games are supported. And a lot of them look great. Some of the Splatoon stuff ain't looking quite right on Nouveau/Firefox, lotta z fighting and I don't know what's going on with Inkopolis. Still, super cool.
> Let’s now define bilinear interpolation for a quadrilateral exactly the same way, except that instead of four texel colors, we’ll have the four vertices of the quad.

This sounds so ridiculously obvious when reading it that I would be surprised if nobody thought of working this out before. Or is the GPU code really difficult to work out compared to how simple the conceptual approach is?

> By the way, the fact that bilinear interpolation creates quadratic splines along diagonals can be exploited to evaluate splines in a GPU texture unit.

That also sounds very interesting!