11-06-2019, 05:16 AM
Hi Richard!
As you say the surface for tilengine outbut must be 32-bit RGB + alpha, not 8 bit. The default windowing already uses SDL2 to create a valid texture:
https://github.com/megamarc/Tilengine/bl...dow.c#L227
Here you can se that the format is SDL_PIXELFORMAT_ARGB8888 . I did some experimentation with shaders a few years ago, I didn't dig deep but I remember they are quite flexible regarding data formats. I was experimenting with a possible implementation of the rendering core using shaders instead of software. But where the current software implementation runs anywhere, the shader-based one would require an OpenGL 3+ capable GPU with the EXT_gpu_shader4 extension for integer indexes and pixel data, that I don't know if it's even supported under GL ES 2.0 required for mobile and RPi. And speed gain wouldn't be dramatic either, as there would be lots of CPU -> GPU sync to properly implement de raster effects. So I eventually discarded it.
However Tilengine can be greatly enhanced with proper post-processing effect shaders, because the current CRT effect is quite basic and could be improved.
As you say the surface for tilengine outbut must be 32-bit RGB + alpha, not 8 bit. The default windowing already uses SDL2 to create a valid texture:
https://github.com/megamarc/Tilengine/bl...dow.c#L227
Here you can se that the format is SDL_PIXELFORMAT_ARGB8888 . I did some experimentation with shaders a few years ago, I didn't dig deep but I remember they are quite flexible regarding data formats. I was experimenting with a possible implementation of the rendering core using shaders instead of software. But where the current software implementation runs anywhere, the shader-based one would require an OpenGL 3+ capable GPU with the EXT_gpu_shader4 extension for integer indexes and pixel data, that I don't know if it's even supported under GL ES 2.0 required for mobile and RPi. And speed gain wouldn't be dramatic either, as there would be lots of CPU -> GPU sync to properly implement de raster effects. So I eventually discarded it.
However Tilengine can be greatly enhanced with proper post-processing effect shaders, because the current CRT effect is quite basic and could be improved.