Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Techniques for dynamic (algorithmic) graphics

I'm programming an application for a 32 bit processor with limited memory (512k flash, 32k RAM).

The display on this device is 128x160 with 16 bit color, which would normally consume 40k ram if I were to buffer it on my processor. I don't have that much RAM, so I'm looking for techniques, tips, tricks, ideas for generating screen data on the fly.

Things that might help:

  • Perhaps you know of a resource for this sort of limitation
  • Maybe you've generated attractive graphics on the fly
  • Is there a generic algorithm I might use to combine elements in program memory (including alpha blending) on the fly while I scan the display
  • Simple vector rendering techniques (or free (bsd/mit/apache) source)
  • ???

I do have a multiplier, but no floating point processor. The display itself has a very simple controller and memory for the display - but reads and writes are expensive so I don't want to use that as my workspace if I can avoid it.

-Adam

like image 500
Adam Davis Avatar asked Oct 06 '08 13:10

Adam Davis


1 Answers

In a way, you are in pretty much the same situation game developers where at the time of the Tandys, Spectrums and early PCs. So, here's my recommendation:

You should read Michael Abrash writings on computer graphics. They were written in a time where a floating point co-processor was an optional piece of hardware, and they describe a lot of the basic techniques (Bresenham lines, etc.) used in the old (supposedly 'bad') software-rendered days.

You can read most of his "Black Book" here.

Additionaly, you can probably find a lot of the old BBS files that most people used back in the day to learn graphics programming here. Just search for Graphics, Lines, and what not.

Hope that helps!

Update: I also recall using this in my first attempts at drawing things on the screen. Can't tell how much time I spent trying to understand the maths behind it (well, to be fair I was like 15 at the time). Very good (and simple) introduction to 3D, and a very nice premier on transformations, polygon-fillers and interpolation.

like image 104
dguaraglia Avatar answered Sep 30 '22 20:09

dguaraglia