Ordinarily, the programmer will be rendering a scene of some description.
Most 3D simulations contain some sort of representation of a world containing
objects and entities, with at least one observer placed within that world,
with images produced of that world from the perspective of the observer. Almost
certainly, the world contains some sort of
spatial data structure that partitions
the world into sections in order to efficiently implement collision detection
algorithms, physics simulations, and for determining exactly which objects are
potentially visible from the perspective of the observer. The
io7m-r1 package remains
completely ignorant of these details: It expects the programmer to pass it
a list of objects and light sources to render, and does not make any attempt
to do any spatial partitioning or visibility calculations of its own. Therefore,
the first step taken by the programmer in most rendering loops is to work out
exactly what needs to be rendered, and then put together a list of things that
need to be rendered in a form that the
io7m-r1 package can use.
Concretely, the programmer constructs
instances (associated with
materials) and
lights, placing them into
an immutable snapshot known as a
visible set.
Because all objects in the
io7m-r1 package
are immutable, it may be that instances, materials, and lights are re-used from the
previous loop iteration (or submitted again with minor modifications via the use of mutable
builders). This is how the illusion of animated materials, lights, and instances
are achieved in the
io7m-r1 package:
If the programmer has created a light
L0 in
the previous rendering loop iteration, and submits a light
L1
in the current loop iteration that is structurally identical to
L0 but with a slightly different intensity, then
there will appear to be a single light in the scene with an intensity that varies over
time. The
io7m-r1 package remains
completely ignorant of the passage of time and doesn't need to be concerned with
keeping any sort of internal state to handle animation - simplifying the
implementation drastically.