Indigo Manual > Techniques

Physically correct modelling of glass

Glass is realistically simulated in Indigo, as a (transmission) medium, which requires a little more care when modelling scenes compared to "traditional" renderers. In this section we will focus on glass, however the principles covered here extend to other media (such as water, fog, etc).

We begin with a concise statement of the requirements, and then go into some details. The executive summary is:

When modelling glass in a scene, it cannot be represented as a single surface; there must be at least two (for entering and exiting), and the glass medium occupies the space between them. Furthermore, the surface normals in all cases must point outwards.

Let's start with the first part: glass must be represented as a volume. The following diagram illustrates how light interacts with a glass pane:

As light travels through the glass medium, its brightness is diminished; this is what gives glass its colour, and it is physically due to the thickness of the glass (and the medium properties), not a "glass colour" modifier at the surface.

If either of the glass faces are not present, the glass volume becomes infinite (since light cannot exit the medium). For example, rendering a house with single-surface glass panes will result in the interior being essentially black, as the light will have lost most of its energy travelling through several metres of glass.

Now that we have described the problem with single-surface glass, we show how to correctly model glass panes. SketchUp is used here, however the same principles apply to all 3D modelling packages.

The simplest way to correctly model a glass pane, is to take a thin box (e.g. a cube squashed in one dimension) and apply an Indigo glass material to it:

SkIndigo has a default glass material, however if you wish to make your own then you should use the Specular material type with IOR 1.5 and transparency enabled.

Here is the result rendered in Indigo:

The next step is to insert the glass box into the window frame. Note that we make the glass pane bigger than the opening in the window, allowing the glass faces to intersect the frame, so that the medium is perfectly contained without tiny gaps.

If you want to be more efficient about this, you can remove all faces except for the front and back - since these should be contained entirely inside the solid wall, they cannot affect the rendering and can be safely removed.

With the glass inserted to the frame, we obtain the desired result: