Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rendering question
Does Tilengine use CPU to render all the sprites and tiles or does it use something like OpenGL to render it on GPU?
The rendering of the framebuffer is entirely done in CPU. What uses a bit of GPU is the windowing system to upscale it with CRT/composite video emulation
I figured as much, the palette stuff tipped me off to the fact that it's probably on CPU. Thanks!
The palette effects could be implemented with GPU shaders starting at OpenGL 3.0 (DirectX 10) or newer. There are other technical reasons for Tilengine being CPU based without any kind of GPU support. GPU is efficient when filling large batches of data without CPU intervention. But Tilengine renders individual scanlines in order, letting the CPU modify any parameter between scanlines. This strictly disaollows parallelization, as scanlines are sequential. The bottleneck of CPU/GPU communication would be higher than the time spent drawing the tiny amount of pixels required by a single scanline. This would be different for very high resolutions, but Tilengine is geared towards classic/retro pixel art, that is low resolution in nature.

This independence of GPU allows to run Tilengine on any kind of 32-bit CPU and render frames on it, even if it doesn't have video output.

Thanks for asking!
The reliance on the CPU, as opposed to a dedicated GPU, is both a strength and a limitation. Modern rendering pipelines are entirely geared around GPUs and their associated float-focused processing. Your average CPU is much more geared toward logical processing and integer crunching. While Tilengine misses out on a lot of modern hardware-assisted techniques, it's legacy approach to graphics is much better geared toward a CPUs strengths. And especially at lower resolutions, it is much more efficient in terms of 2D tile-based rendering, using numerous tricks and shortcuts inspired by classic consoles. It is an especially desirable option when dealing with limited hardware. It's one of the best options I've found for implementing classic game graphics on a Raspberry Pi.

And the windowing support being separate from the engine's core rendering functionality is actually quite the boon. If you don't like the default windowing, you don't have to use it. I've experimented extensively with embedding and using Tilengine in less conventional ways, and had plenty of success doing so. I even managed to embed Tilengine into a Unity plug-in, no problem.

If you want a little of the best of both worlds, I recommend shifting away from Tilengine's default windowing, and cooking up your own custom implementation using an OpenGL programmable shader pipeline. This would provide you with some significant extra muscle for post-processing, while still playing to Tilengine's core strengths.
Hi Richard!
Great answer, I couldn't have explained it better. Thanks for this explanation, you have great understanding about Tilengine.
How are you doing?

Forum Jump:

Users browsing this thread: 1 Guest(s)