Documentation
Techniques Manual
Overview
This manual gives an overview of techniques to use to create fantastic renders using Indigo.
This manual is not specific to any modelling package. You should read your modelling package manual and be well versed in using the Indigo GUI to get the most from this manual.
With that out of the way, let's get started - and we hope you enjoy creating absolutely photorealistic renders!
Acknowledgements
Glare Technologies would like to thank the following people for their contributions to the techniques manual: Ben Nolan, Nick Chapman and Yves Colle.
The image on the cover of this manual is © Copyright Godzilla.
Indigo Materials
Indigo has 7 different material types. Each one represents a different physical material. These different material types are due to the way light interacts with a surface, eg Metals are very different materials to flat wall paint.
Here is an overview of the materials:
Phong
A pink phong material
This material is a shiny material. Commonly used for shiny paints or any metals. In particular, phong will have a "specular highlight" where the light is completely reflected. Increasing the "exponent" of a phong material makes the specfular highlight larger and more powerful.
Phong is useful for anything that has a lacquer applied to it - for example a shiny wood floor or a car paint.
As an aside - Phong is named after the inventor of the material technique - "Bui Tuong Phong".
Diffuse
A pink diffuse material
Diffuse materials are flat, matte surfaces that don't have shiny edges. Flat wallpaint, or a piece of paper are good examples of a diffuse material. There will be no particular reflection from a diffuse material.
Oren-Nayar
A pink Oren-Nayar material with sigma 1.0
Oren-Nayar materials are very rough materials that scatter light in every direction. They are rougher than diffuse materials. Oren-Nayar is useful for creating surfaces that are like clay, or generally rough. They aren't shiny at all. The sigma parameter of an oren-nayar material controls the roughness. Higher values of sigma makes the material more rough.
Note - if you wanted to create a material that is actually bumpy and rough, you should look into using bump maps (see below).
This material type is named after Michael Oren and Shree K. Nayar, the inventors of this material technique.
Specular
A glossy transparent material. In the material database as "Ruby".
Specular materials are quite powerful and can be made to act as perfect reflectors (like a mirror) or as a fully transparent glass and anything in between. These materials are a lot slower than diffuse, phong or oren-nayar and should only really be used when a partially transparent material is needed.
Specular is commonly used with a medium inside it to make sub-surface-scattering materials.
Blended materials
Blended is another material type that lets you create compound materials that are a combination of other materials. Blended materials have a 'blend map' that specifies how to blend the two sub-materials together. For example, you might have a shiny phong material combined with a rusty diffuse material. The blend map would show where the rust spots show through.
Null material
The null material is only really useful for debugging your scenes, as it does not interact with light in any way.
Exit portals
This is a fake material for speeding up your renders. See the section on Exit Portals later in the manual.
Lighting basics
Indigo does lighting very differently from the modelling packages you are used to.
For starters - Indigo does not have:
-
Point lights
-
Spotlights
In fact, Indigo has no "light objects" at all. This is because most of the light types used in modelling packages are approximations - and Indigo is physically based. In the real world, it's quite impossible to create a lightsource that is dimensionless and infinitely bright (which is what most point lights are).
In Indigo there are only three ways to light a scene:
-
Indigo's sun and sky model
-
Light emitting environment maps
-
Light emitting materials
When you get started with Indigo, the sun and sky model is the simplest to use to get your bearings. It lets you specify the time of day (and thus the angle of the sun) and will generate a nice light source that matches northern-hemisphere skies.
The light emitting environment maps can be useful in certain cases too - but the most important tool to learn in Indigo are emitting materials.
Light emitting materials
Instead of having custom light objects - Indigo lets you make any model (or mesh) into a light emitting object. This means that if you wanted to have a lightbulb in your scene - instead of having a point light in the middle of where the bulb should be - you can actually model the glass bulb and set the entire glass bulb to emit light.
A lightbulb modelled correctly with a filament inside it.
This means that when you look at the lightbulb, it will look correct, and the light that comes from the bulb will be distributed around the scene correctly.
Lightbulb with the glass removed to show the glowing filament
Rays of light in a dusty room
A nice effect you can create with Indigo is to show the rays of light entering a dusty room, like in a big old church. See this photo for example:
SketchUp model of a big box room with a ray of light shining through a small window and onto the model of a person.
The way to model this - is like so:
-
Create your model with a sun/sky model and some windows to the let the sun in, position the sun so that it shines a ray of light into the scene
-
Create a cube around the entire scene, and set it to have the fog material from the material database. This is a subsurface scattering material that simulates having dust in a large room.
-
Create an exit portal in the window (see section on exit portals)
-
Render it!
This is a physically correct way to create a shaft of light - and gives an awesome feeling and is very configurable. For example - you can put stained glass in the window and create a realistic coloured shaft of light.
Troubleshooting
The downside to this technique is that it is very computationally intensive and easy to set up your scene incorrectly. If you are having problems rendering your scene - try these tips:
-
Ensure you are using the bidirectional path tracing rendering technique
-
Try rendering the scene without the fog cube to ensure you have your sun and exit portals set up correctly
-
Try changing the subsurface scattering distance to a higher value (if you aren't seeing any fog) or a lower value (if the entire scene has turned white with fog
-
Try camera tonemapping to ensure that the bright spots of light aren't overpowering the column of light
-
Ensure your exit portals are facing the correct direction and casting light into the scene, not out into the atmosphere
-
Try reducing the aperture of your camera to f/22
Other possibilities
You can enhance this technique by putting stained glass between your exit portals and the room, so that you can have coloured shafts of light. You can also create various different shapes of light column by having different shaped windows.
Exit Portals
Exit portals are a technique for accelerating your renders. They are used for rendering interior scenes. If you have a room that is completely enclosed and only has windows to the outside - you can replace your windows with exit portals and it will tell Indigo to only simulate light inside the room.
Rendering a large room with a single window covered by an exit portal. This render was stopped after 3 minutes.
The same scene without an exit portal stopped after 3 minutes. Notice the scene is much noiser.
Without exit portals, Indigo will try and simulate only the visible light rays, but it will inevitably simulate unneeded light rays. For example - there's no point bouncing light off the roof of the house if you're rendering the basement.
To enable exit portals - draw a rectangle (or a plane) over any openings in your interior scene. Then apply a material called 'exitportal' to them and configure the indigo material type to be 'exit portal'.
Indigo will start casting rays from the exit portal instead of from the surrounding environment. Note that this may change the angle of the sun by a degree or two - you should check your sun position after adding exit portals.
Troubleshooting
If you have problems using exit portals - ensure the exit portal rectangles you have created are facing in towards your scene - not facing out to the environment.
Also ensure that you have no gaps or holes in your scene where light could be leaking out into the atmosphere - as that can produce strange and unpredictable results.
Exit portals are an advanced technique and are only necessary if your scene is taking too long to render normally. They are worth learning though and can speed up your renders hugely.
Indigo Shader Language
ISL stands for Indigo Shader Language, the language for creating procedural materials in Indigo. Since it's a functional language, it can be a bit tricky to create some patterns that are easy enough in an imperative language.
For example, lets say you want to write a shader to make a polka-dot pattern.
In an imperative language you might write some code like
def
fillWithColour(background_colour):
for(int x=0; x<W; ++x){
for(int y=0; y<H; ++y){
drawDot(x, y, dot_colour);
}
}
But in ISL, you can't do things this way. You have to write a
function that returns the colour, and that depends only on the
position and/or UV-coordinates of the current surface point being
shaded, e, g:
def
getColourForPoint(u, v):
if( the point (u, v) is inside a dot ){
return dot_colour
}else{
return background_colour
}
This tutorial shows you how to use such a functional technique to create regularly repeating patterns, like polka-dots, with ISL.
Lets start by discussing the fract function.
As described in the Indigo Renderer Manual, fract takes a single real number, and returns a real number:
fract(x) = x - floor(x)
The useful thing about this function, is that it repeats regularly across the real number line, with period 1. We can use this function to create more complicated behaviour.
So lets say we want to create some stripes, such that they alternate in the U direction of the UV coordinates. Suppose we have a foreground and background colour.
Using the fract function above, we can can assign the foreground colour when fract(x) < C, and the background colour when fract(x) >= C, where C is some constant between 0 and 1. If C is 0.5, the stripes will have the same width as the background stripes.
Let's see how that looks in real ISL:
<material>
<name>previewmaterial</name>
<diffuse>
<albedo>
<shader><![CDATA[
def eval(vec3 pos) vec3 :
if(
fract(doti(getTexCoords(0))) < 0.5,
vec3(0.9, 0.0, 0.0), # Red
vec3(0.2, 0.2, 0.2) # Dark Grey
)
]]></shader>
</albedo>
</diffuse>
</material>
And the resulting render:
The shader with fract(x), so slowly repeating stripes.
In this example the foreground colour is red, and the background colour is dark grey. This example looks a bit wierd because the stripes are large compared to the model. We can solve this problem by multiplying the UV coordinates by a number greater than one before we pass the value to fract, e.g we could use something like fract(10 * x)
The ISL is then:
def eval(vec3
pos) vec3 :
if(
fract(doti(getTexCoords(0)) * 10.0) < 0.5,
vec3(0.9, 0.0, 0.0), # Red
vec3(0.2, 0.2, 0.2) # Dark Grey
)
And the resulting render is:
The shader with fract(10 * x) so more repeating stripes.
So, at this point in the tutorial, we have more-or-less solved the problem of how to create regularly-repeating patterns, at least with respect to the U coordinate (e.g. in one direction).
Going Further
To learn more about using Indigo - see these resources.
The Indigo website:
http://www.indigorenderer.com/
The Indigo materials database:
http://www.indigorenderer.com/materials/
The Indigo forums are a lively place of debate.
http://www.indigorenderer.com/forums/
If you need support - email:
We hope you enjoy using Indigo and look forward to seeing your renders!