Closed Helco closed 5 years ago
We should consider the following pixel formats:
Out of this comparison Atkinson Dithering should be most suitable, because of reduced speckling and the inherent support for fixed max/min values (contouring). In any case an on-the-fly error diffuse dithering is not possible with out renderer (semi-random draw order), which means there needs to be a pre-dithering framebuffer. Atkinson dithering uses the divisor 1/7
which means we need 2 bits more per pixel`, this would mean:
Pixel Format | Bits per Predither pixel | Predither buffer size (144x168) | Comment |
---|---|---|---|
1Bit grayscale | 3~=4 | 12096B = 11,8KiB | Useless |
2Bit grayscale | 4 | 12096B = 11,8KiB | Light dithering |
4Bit grayscale | 6~=8 | 24192B =23,6KiB | Better dithering |
Dithering on basalt/chalk/emery is useless because of its native color and aplite might not be able to do any kind of dithering. Thus diorite is (for the moment) the only platform which might profit from dithering. Which level of dithering can be used will be shown by the RAM usage of the textures.
A possible way to optimize ram usage with dithering might be to exploit the framebuffer as temporary dithering buffer, this way ram usage for 2Bit dithering would be halved (to 6048B = 5,9KiB). Assuming a max code/data size of 12KiB a total of 6KiB would remain for a few (very small) textures (most suitable 24 32x32 textures). Maybe we should explore how to get more os-owned memory.
Contouring would replace the wall filling by only rendering:
memset
call (on 1Bit framebuffer additionally up to two operations in the fom of p' = p & ((1 << remHeight+1) - 1)
or p' = p & ~((1 << 8-remHeight) - 1)
x1 <= x2
-> bresenham algorithmyTop
/yBottom
Actually, why not a black/white mode, as suggested to us it might look good (enough) to just draw the contours of the wall, planning notes to that should go here: