Materials
A material describes the surface properties
of an object. A material may either be
opaque or
translucent. An object with a
opaque
material completely occludes the pixels of all other objects that appear
behind it. An object with a translucent
material is blended with the objects that appear behind it.
Materials consist of a multitude
of different properties describing different aspects of the surface. For example,
most opaque materials have data describing all of the following:
An extremely trivial material (with a simple red albedo and no other properties)
applied to a square, lit by a directional light:
A complex material (with mapped normals, specular highlights, an environment map, and a textured albedo)
applied to the same square, lit by a spherical light:
Materials are immutable once created, but are created through the use
of mutable builder types. This allows renderers to effectively support
"animated" materials without actually needing to know anything about them;
the renderers see ordinary immutable materials, but the programmer is supplying
new materials each time the renderer is called, giving the illusion that one
material is changing over time. As an example, the type of builders for
opaque materials is
KMaterialOpaqueBuilderType.
Light groups
Light groups are a means to partition
a visible set into separate lighting environments. An
instance belongs to exactly one
light group, but a given
light can be placed into any number
of light groups.
The io7m-r1 package,
due to the current state of graphics hardware, implements purely
local illumination
. Because of this,
when using lights that do not project shadows, it is possible for
lights to "bleed" through objects that would normally occlude their
radiance had the renderer implemented physically correct lighting. As
an example:
The visible set contains three lights: A red spherical light
s0 in the left room,
a white spherical light
s1 in the middle room,
and a blue spherical light s2
in the right room. The visible set contains four instances: The left room
i0,
the middle room i1,
a piece of furniture i2
in the middle room, and the right room i3.
None of the lights are configured to cast shadows. Note
that the red and blue lights bleed into the center room as if the two
dividing walls were not even there! Light groups can help to
solve this issue (without requiring shadow mapping).
First, three light groups are created:
g0,
g1, and
g2. The light
s0 and instance
i0, are added to
g0. The light
s1 and instances
i1 and
i2, are added to
g1. Finally,
light s2 and
instance i3 are
added to g2. With these
groups configured, the renderer produces the following image:
Instances i1 and
i2 are no longer affected
by lights s0 and
s2, and so on. The image
looks more physically correct, at the expense of having somewhat
hard transitions between the rooms, without actually having to
calculate any shadows
.
Light groups can also be used for other miscellaneous visual effects.
For example, an object in a visible set could be highlighted by placing it
in its own light group, and adding a strong red directional light
to that group. No other objects in the visible set would be affected by the
light and the object would, as a result, be displayed very conspicuously!
The majority of visible sets will contain only a single light group. They
are intended to assist with working around the lack of
global illumination, and with
implementing specific visual effects.