Close

Open GL ES Rendering

A project log for Pi Chart

A wireless nautical chart plotter based on a Raspberry Pi and a sunlight readable screen.

erland-lewinErland Lewin 02/19/2016 at 21:580 Comments

So I guess writing the software in 300 lines of code was too easy for me ;-)

I was annoyed at the jerky response of the javascript / HTML code in the web browser under X windows. So I gave a try at writing some code in OpenGL (a first for me), thereby bypassing many layers of software and using GPU accelleration to render directly to the screen without X windows.

I now have a first rough version in about 1500 lines of C code (not checked in yet, needs some more work), that should give me buttery smooth graphics (60 Hz update) when zooming and moving.

My belief is that the SD card's speed is the main bottleneck. I use a background thread to read the compressed, palette format tile PNG images into RAM cache, and when I need to draw them as textures with OpenGL I uncompress them, and pass them to OpenGL to put in the graphics memory.

Maybe I could have accepted the jerky response to more quickly arrive at a "Minimum Viable Product", but part of the point of hobby projects like this is to make solutions that are beautiful from an engineering point of view.

There's still stuff to do in the OpenGL code - support non-integer zoom levels for smooth zooming, referencing higher zoom level tiles when higher magnification tiles are missing, and more.

I've received the NRF51822 Bluetooth modules, so I can start working on them also, I need to design the PCB for the Raspberry Pi power solution, and assemble all the parts into a tablet. My current plan is to finish the OpenGL basics, then design the PCB for the Raspberry Pi power circuit so I can have that made while I get the Bluetooth stuff working.

Discussions