View Single Post
Old 12 November 2009, 11:14   #4
CodyJarrett
Global Moderator
 
CodyJarrett's Avatar
 
Join Date: Mar 2001
Location: UK
Age: 46
Posts: 6,162
Chunky vs Planar

Chunky vs Planar

How are graphics stored in memory? One possible graphical storage system would be to store the value (colour) of each pixel in a long row. For example, in order to store an image with up to 256 colours the following values could be placed in each consecutive memory address:

00000000 (colour no. 0)
10010000 (colour no. 144)
00010110 (colour no. 22)
00010110 (colour no. 22)

In the above examples there are four pixels with colours 0, 144, 22 and 22. This is a Chunky graphics system and is the method used by the Doom-era PC.

The Amiga uses a different system; Planar graphics. The bits for each pixel are displayed in different locations (bitplanes) in memory and must be combined in order to find the colour of a pixel that is to be displayed. For example, an eight colour Planar system would use the following bytes:

Bitplane 1 0 0 1 1
Bitplane 2 1 1 0 0
Bitplane 3 0 1 1 1
Bitplane 4 0 0 0 0

Compare this to the Chunky system:

00000100 00000110 00001010 00001010

In the Chunky system each colour is displayed one after the other. In the Planar system each Bitplane row is stored at a different location in memory.

In order to find the first colour the Chunky system needs only to make one read operation: 0100. The Planar system needs to go to bitplane 1 then read 0, go to bitplane 2 then read 1, go to bitplane 3 then read 0 and finally to bitplane 4 and read 0.

A 256 colour display would need eight reads since eight bits are required to store up to 256 numbers e.g. this is one pixel:

Planar
Bitplane 1 0...
Bitplane 2 0...
Bitplane 3 1...
Bitplane 4 0...
Bitplane 5 0...
Bitplane 6 1...
Bitplane 7 0...
Bitplane 8 0...

The Chunky system is clearly faster than Planar since only one memory read is required per pixel rather than up to 8 reads. This is one reason why Doom clones on the Amiga are quite slow compared to the PC.

Planar, on the other hand is supposedly better for scrolling, parallax type games. Less memory is also used by the Planar system to display low numbers of colours. This is because it doesn't require a full memory address for a small number. For example, a sixteen colour Planar pixel needs 4 bits whereas Chunky would probably use the whole byte (8 bits).
CodyJarrett is offline  
 
Page generated in 0.04242 seconds with 11 queries