Introduction to Global Illumination

From Kray
Jump to: navigation, search

What is GI?

There is a nice definition of what GI is in Wikipedia:

Global illumination algorithms used in 3D computer graphics are those which, when determining the light falling on a surface, take into account not only the light which has taken a path directly from a light source (direct illumination), but also light which has undergone reflection from other surfaces in the world (indirect illumination).

Images rendered using global illumination algorithms are more photorealistic than images rendered using local illumination algorithms. However, they are also much slower and more computationally expensive.


Higher computational complexity of GI algorithms is not the only disadvantage compared to local illumination rendering. There are more rendering parameters to control and we must pay bigger attention to scene lighting and materials.

Light and material models used in 3d packages (such as LightWave) are not always physically correct. For example in LightWave you can create material that has diffuse 100% and reflection 100%. Diffuse + reflection = 200% and that means material reflects (in sense of total light reflection, not specular reflection only) more light that recieves. Physicall incorrectness in non-GI scene helps to hide lack of global illumination and often looks better than correct models, but in GI scene such models can look very wierd and unnatural.

Kray does not force user to use physically correct models. They are sometimes useful to make rendered images look more dramatic, it is important to know when the scene matches the laws of physics and what will happend if we break them.

Lighting

If Kray says Physically incorrect light model in scene with global illumination one of your light breaks the laws of physics. Read this section to find out why.

Ambient light

Is a basic way to mimic GI for scenes without global illumination. Without it we get completly black shadows.

If we enable GI and use ambient light objects on the scene will glow (because they actually emit light). For best results when you use GI, set ambient light to 0%.

Background

Background also act as a light source in global illumination scene. Note that photons tracing does not support background lighting since there is no point from where photons can be emited (use lightmaps instead).

Luminosity

See luminosity in materials section.

Other lights

Distant lights

Has similar limitations to background. It is ok to use them in GI scene, but they are not supported by photon maps.

Intensity of lights that is higher then 100% also has a physical sense and can be used.

Point, Spotlight, Linear, Area

They are physically correct if Intensity falloff is set to Inverse distance ^ 2. Otherwise they are not physically correct. No matter if they are correct or not, they work with light maps, but they need to have Inverse distance ^ 2 in order to work with photon maps.

Materials

Luminosity

Object with surface material Luminosity>0 material really emits light and with GI enabled can illuminate your scene (this can even work without GI enabled, if you choose "Compute as direct" Luminosity model). If you use luminosity to get better shading only your object will glow (similar to glow caused by ambient light). You are not limited to 100% luminosity. You can use values over 100% as well (same way as light intensity). What is nice in luminosity light sources is that unlike regular lights they can have a texture.

Balance

As I mentioned on the begining in LightWave you can create surface that reflects more light than recieves. That gives more freedom to artist and does not make problems in local illumination scenes.

Problem can appear when we use surface that reflects more then it recieves in global illumination scene. This can cause unlimited light bounce, glowing objects, strong artifacts.

Balance rule

General rule: Diffuse+Reflection+Translucency<100%. Notice that it is "less then" not "less or equal then". In reality no material reflects all the light that hits its surface. The same rule is valid if we use gradients or textures for every gradient angle and texture pixel. Also notice that if we have texture color RGB (128,128,128) and Diffuse 100% material still fits Diffuse<100% rule. In fact it is 50% diffuse because it is the same as RGB (255,255,255) and Diffuse 50%. Pure 100% diffuse reflection is when color is RGB (255,255,255) and Diffuse amount is 100%.

Luminosity

Balance rule does not affect Luminosity. Feel free to use 300% Luminosity and 95% Diffuse for example.

Transparency

Transparency (the one from Basic tab in surface editor) fades Diffuse channel (so 90% Diffuse + 40% Transparency is ok)

because:

90% diffuse * (100%-40% transparency fade) + 40% transparency = 54% diffuse + 40% transparency


Transparency does not fade Reflection (so 90% Reflection + 50% Transparency is too much).

Additive transparency does not affect Diffuse amount (so 90% Diffuse + 50% Addtive transparency is 140% and is not ok).