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!
I took a shot at antialiasing this:
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...
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!
[Please log in to post a comment]