[comp.sys.amiga] fractals 4 real-time

ssingh@watserv1.waterloo.edu ($anjay "lock-on" $ingh - Indy Studies) (12/17/89)

The following is a transcript of a letter from Loren Carpenter dated
April 18, 1989. It details the use of fractals for real-time graphics
rendering. I thought it might prove interesting to those who are also
working on their own implementations of these algorithms. I have Loren
Carpenter's acknowledgement of this posting.


Relative to the fractal game algorithms...

Neither I nor anyone at Lucasfilm ever published anything, as far as I can
remember. I did the one for Rescue and the folks at LFL adapted it for
Eidolon and Koronis later. Ballblazer doesn't use any fractal code.

The algorithm is the simplest possible midpoint subdivision, subject to
the constraint that the landscape be consistent from frame to frame.
The random displacement is derived from 2 bits (sign & overflow) of the
8-bit sum of the tags on the ends of an edge.

if overflow then
	displacement = 0	/* bisect the line */
else
	if negative
		displacement = -edge_length/4
	else
		displacement =  edge_length/4

The landscape is a 16x16 mesh of edges, repeating forever over the plane.

There is a lot more detail, especially about perspective, but I'm not sure
LFL wants me talking about it yet.

			Loren Carpenter

Post Scriptum: For an in-depth treatment of fractals for graphics rendering,
see Communications of the Association for Computing Machinery, Volume 25,
Number 6, pages 371-84. 

The "...constraint that the landscape be consistent
from frame to frame..." may refer to the idea of pixel replication as seen
in games like Afterburner and Outrun. Note that as an object gets larger,
it also gets blockier. Fractal code can appear to create detail very
efficiently, making the object appear more complex than is otherwise possible.
This can also be seen in the player vehicles in Ballblazer.

Regarding perspective, two main techniques have been used in the past that I
have noted. One is to use different shades of grey for mountains of 
different distance, and gradually change colours as the player moves closer
or farther away. The other is most noticeable in Rescue on Fractalus,
where there is a mesh that converges in the distance on a vanishing point.

$anjay "lock-on" $ingh
ssingh@watserv1.waterloo.edu

"A modern-day warrior, mean mean stride, today's Tom Sawyer, mean mean pride."
-- 
$anjay "lock-on" $ingh
ssingh@watserv1.waterloo.edu

"A modern-day warrior, mean mean stride, today's Tom Sawyer, mean mean pride."