NanoBoyAdvance icon indicating copy to clipboard operation
NanoBoyAdvance copied to clipboard

Correct subpixel rendering?

Open timfenney opened this issue 1 year ago • 4 comments

I am trying to find out how to emulate GBA titles with correct subpixel rendering. At 6x the GBA resolution of 240x160, we would have a window size of 1440x960. This would allow each logical GBA pixel to be rendered in a 6x6 rectangle on the emulators window area. This could be broke down to render three 2x6 rectangles, one for each subpixel:

BB GG RR BB GG RR BB GG RR BB GG RR BB GG RR BB GG RR

Iss there any work in progress to accomplish this? It will make fonts look good, in the case of subpixel font smoothing, as well as anything else (antialiasing) which uses the subpixel layout (simple drawing algorithms like bresenham line drawing etc.).

timfenney avatar Dec 03 '22 22:12 timfenney

Currently there is no work being done on this. Can you give concrete (visual) examples of where this would be particularly useful/noticeable?

fleroviux avatar Dec 05 '22 18:12 fleroviux

There is some info here: https://www.coranac.com/tonc/text/tte.htm, search on page for the text, "sub-pixel rendering".

Tonc's Text Engine uses the technique, which was probably used in a number of homebrew demos and games. I'm not sure how many commercial games used the feature, as I used the GBA mostly for programming.

timfenney avatar Dec 12 '22 21:12 timfenney

However I should say, from a technical perspective, as long as the emulator can produce a 240x160 screen buffer that shows the "correct" colours, I would think a shader or something could transform that buffer into one broken out into "720x160" subpixels.

timfenney avatar Dec 12 '22 22:12 timfenney

I have a pretty accurate GBA LCD shader with subpixel emulation in SkyEmu. Maybe that would work for you?

skylersaleh avatar Feb 27 '23 04:02 skylersaleh