RE: https://mastodon.gamedev.place/@eniko/116232581608004216

instead of dealing with any of that i spent the afternoon refactoring so that i can include my library multiple times with different suffixes. this will be useful for supporting different color bit depths and such without making my code completely impossible to maintain

i was looking at 9 functions

1. flat color
2. gouraud
3. luminance grayscale
4. luminance with color ramp
5. textured
6. textured with flat color
7. textured with gouraud
8. textured with luminance grayscale
9. textured with luminance with color ramp

times 6 color depths (32, 24, 16 555 & 565, 8 332 and 8 bits with CLUT) is 54

(times two for depth buffer is 108)

now instead it can just be one include per desired supported mode

though tbh i'm dubious on the usefulness of 24 bit vs 32 bit color
as you can see the 332 bit rgb 8 bit mode is working perfectly
its ok don't worry i fixed it

ok it's actually looking proper now except that it throws an access violation when i exit so that's probably not an amazing sign

update: i fixed the access violation

you're telling me 3 bits of red/green and 2 bits of blue isn't enough to smoothly gouraud shade a triangle? i'm shocked, shocked!

well. not that shocked

@eniko Just means you need more dither :-)

@eniko When I was writing drivers for 3D cards back in 1997, one thing our card didn't have was MSAA. But we could of course do dumb SSAA - just render 4x bigger, then shrink down.

I figured out we could do the 4x render in 332 with dithering, then when we did the shrink we'd read that but render to 565, because the extra colour bits came from blending the dithered pixels together.

I sent A/B pictures around the office, and nobody could tell the difference, but it was 15% faster. SHIP IT!

@TomF that's kind of amazing
@eniko I remember being pretty sure it wouldn't work, but I had to know...
@TomF @eniko
I observed a similar effect with some people's profile pictures here (forgot who :-/): when they're small (in the timeline) they look almost like photographs, but when looking at their profile so the picture is bigger it turns out to be pixelart with dithering
@Doomed_Daniel @TomF @eniko
You probably weren't referring to me; mine is a dithered photo. [And a different dither on alt @BRicker ]
@n1vux @TomF @eniko @BRicker
no, but yours also shows how well downscaling dithered images works :)
@Doomed_Daniel
FWIW, I uploaded that at the same 339×339 resolution it has stored and is returning, with block mega-pixels formed intentionally in the dither process (Fotocx), which cranks down the PNG size greatly, and allows sub-sampling to be harmless from what I planned. IIRC I had to select a square from the vertical 339×420 dither output