ensisoft / detonator

2D game engine and editor 💥💣
GNU General Public License v3.0
305 stars 12 forks source link

Improve text rendering output #207

Open ensisoft opened 1 week ago

ensisoft commented 1 week ago

Find a way to improve the text rendering output.

bad-rendering

The attached screenshot shows multiple problems:

ensisoft commented 1 week ago

sample-text-buffer

The raw text raster from the text rasterizer looks like this

ensisoft commented 1 week ago

A problem related to transferring the text to the screen is

Seems that ideally when the rendered output of the text matches exactly the rasterized text (as it should) we'd like to transfer the pixels directly (pixel per pixel) to the render target color buffer.

Theoretically one could resolve the MSAA FBO RT color buffer and then use a compute shader to write to the color buffer texture but this would not work when there's a need to do stencil testing.