Improving 3D graphics for Arduino LCD shield

Arduino Uno features Atmega328 microntroller with 2KB of RAM. When you start working with graphics LCD, memory melts down immediately. One of the common GLCD shields for Arduino is Adafruit’s LCD shield which features 320×240 color graphical LCD driven by ILI9341 driver IC. There is a ready made library that allows drawing graphics with few lines of code. This is OK for simple drawings and menus, but when you start working with some motion and animation flickering and tearing occur. This is due to limited memory on Arudino. Simply speaking there is no space to render whole frame off-screen. 340X240 frame would require 500KB.

M Rule starting looking for more optimal ways of displaying and updating graphics on screen that would minimize these effects and make graphics update smoother. He started tweaking Adafruit’s library with custom solutions that makes rendering stages less visible to human eye. One of the ways is to render frames on top of each other first and then remove unnecessary pixels. This works great with mesh graphics, but 3D surfaces there is also a Z buffering involved. Due to RAM limitations there is almost nothing to do here. Anyway simple additional tricks adds up to overall performance. Some of them involve changing I/O operations to direct port read and writes, reducing color accuracy, terminating commands early, reducing flow controls, unrolling loops and more. All these techniques sacrifice portability over speed. If you would like to give a try, there is a GitHub repository of modified library.

[..Source link..]

Bookmark the permalink.

Comments are closed.