Log In  


Cart #subpix-0 | 2020-11-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
16


I recently saw a post on twitter about "subpixel rendering," and I wanted to try my hand at a few functions! A couple of hours later... I now have this. I can't promise it's perfect, nor do I have all of the shapes I want to try, but I'll release it now if anyone is interested.
Feel free to suggest any other shapes as well as finding bugs/fixes!

16


6

I took a shot at antialiasing this:

Cart #subpix_aa-0 | 2022-01-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

It's basically just rendering 4 times with different offsets to different bitplanes, then setting the palette appropriately. The key section is:

 poke(0x5f5e, 0b00010001)
 draw(0.25+ox,0.25+oy)
 poke(0x5f5e, 0b00100010)
 draw(0.25+ox,0.75+oy)
 poke(0x5f5e, 0b01000100)
 draw(0.75+ox,0.25+oy)
 poke(0x5f5e, 0b10001000)
 draw(0.75+ox,0.25+oy)

I'm pretty sure this must have been done before but I haven't seen it...


5

New version, does things a little differently. Uses only 3 samples per pixel, laid out in a triangle pattern, and refreshes only one of those per frame, so in some sense the "true" refresh rate is only 20Hz. Super cheap, though, basically the same rendering cost as the original!

Cart #subpix_aa-1 | 2022-01-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5



[Please log in to post a comment]