Helco / PebbleOfDoom

A platform is only hackable when some form of Doom is ported to it, let's make Pebble hackable!
MIT License
6 stars 0 forks source link

Renderer: BW mode #77

Closed Helco closed 5 years ago

Helco commented 6 years ago

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:

Helco commented 5 years ago

WIP notes:

initialize the renderer with capability vector:

Pixel format

We should consider the following pixel formats:

Dithering

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.

Dithering on aplite

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

Contouring would replace the wall filling by only rendering: