Fwd: Quesa 0.0.2

Jeff Pierce jpierce at cs.cmu.edu
Wed Jul 28 16:14:21 UTC 1999


At 08:01 AM 7/28/99, Andrew C. Greenberg wrote:
>I'm pretty sure I worked out the gist of the meaning of these terms. 
>"retained mode framework" and "immediate mode" from the context. 
>However, a little knowlege is a dangerous thing, and I don't know 
>what I don't know about this stuff.  Accordingly, I'd be obliged if 
>someone would offer definitions so I can be sure.

Think of immediate mode renderer as having amnesia.  To draw a frame, you
tell it the perspective transform you want, the lights you have in the
scene, and then you proceed to tell it the composite matrix (storing the
position, rotation, and scale), texture, and mesh for each object.
However, in the next frame, if you just tell the renderer to draw, it'll
give you a funny look and say "Draw what?"

A retained mode renderer, on the other hand, keeps track of the objects in
the scene; most renderers these days use what's known as a "scene graph" to
keep track of the objects in the scene and their parent-child
relationships.  So when you tell a retained mode renderer to draw, it walks
the scene graph and renders the scene for you.

Right now Squeak-Alice essentially implements a retained mode on top of the
Balloon 3D immediate mode that Andreas implemented.  Squeak-Alice keeps
track of the parent-child relationship of objects (this is why you can turn
the bunny's head independently of the bunny), and every frame tells the
immediate mode renderer how to draw the scene.

There are a couple of nice things that Squeak-Alice does that most
traditional retained mode systems don't do.  For example:

- Cameras are in the scene graph.  This allows you to make the camera a
child of the bunny, so that when you move the bunny around you also move
the camera.  BunnyCam in action.

- Alice also keeps two matrices per object: the composite matrix and a
resize matrix.  A nasty side effect (at least for novices) of storing scale
in the composite matrix is that resize operations scale space.  So if you
resize the bunny to twice its original size it now moves twice as far when
you say "bunny move: forward distance: 1".  To get around this, every
object has a resize matrix that allows me to resize the mesh (and offset
from the object's insertion point so that when you scale the bunny his head
moves to the right place) while keeping the space constant.

Hope that helps,
Jeff





More information about the Squeak-dev mailing list