<< Vector [Table of Contents] >> Image
uni.render.Composite
A composite allows you to bring together one or more layers in 2D or 3D space, and show them on the screen. Each layer is essentially a rectangle which can be moved, scaled and rotated. There can only be one composite for each window, but there may be any number of layers in a composite, and layers can have child layers.
Caching
Graphical appliactions typically break down into those that redraw the screen as seldom as possible, and those which do so as much as possible. Typically a word processor would be the former and a 3D game would be the latter. There are pros and cons to both approaches. The word processor only uses a fraction of the computer's power to draw it's simple interface occasionally but is plain to look at and interact with, while the 3D game presents the user with animation of complex graphics at the cost of heavy resource usage.
The happy-medium that UniD seeks is to break the interface into layers which can each be updated at an independent rate of one another. Once updated, they reside on the graphics card, taking the strain off of the CPU. Some layers may be updated very often, while others hardly ever, but the composition of the layers is usually taking place about 30 times per second, which is fast enough to convince a user of instantaneous movement.
Order of Operations
When an application sets out to draw something, it must first draw on all the layers it wishes to update and then composite those layers together in the window so the user can see them. This is an example of the graphics in a layer and a composite of all layers being rendered in the correct order.
with(comp) { begin; // This section doesn't have to run if the layer's contents are the same with(layer) { begin; perspective(45.0); // render 3D graphics end; } clear; orthographic; drawLayers; end; }
