Image Based Lighting

 

These pages describe how to light scenes using High Dynamic Range (HDR) images. This can be done with two methods, the Sky shader and the Skydome Light. It is recommended that you use the Skydome Light as this uses Multiple Importance Samping (MIS) to fire more rays towards bright, important areas of the environment map. This way, shadow details are preserved, while at the same time keeping noise levels low. There is no need to pre-blur the environment map used for diffuse/glossy rays as you normally would need to do when using the Sky shader.

 

Should I use a background Sky shader or a Skydome light?

The skydome_light will most of the time be more efficient, in both speed and noise, than hitting the sky shader with GI Diffuse rays. The only situation where using a sky shader may be faster than the skydome_light is when the environment texture is a constant color or has very low variance (see image below). There are various reasons why using a skydome_light is more efficient:

  • The skydome_light uses importance sampling to fire rays to bright spots in the environment, therefore automatically achieving both soft and sharp shadows; sampling the sky shader with GI rays cannot achieve hard shadows in reasonable times, you will need huge amounts of GI samples.
  • The environment map lookups for the skydome_light are cached rather than evaluated at render time. Since texture lookups via OIIO are very slow, this caching results in a nice speedup, usually 2-3x faster than uncached (if you are curious, you can switch to uncached lookups by setting options.enable_fast_importance_tables = false and measure the difference yourself).
  • The skydome_light is sampled with shadow rays, which can be faster than GI Diffuse rays because shadow rays only need to know that any hit blocks the light (rather than the first hit). This also means the sampling quality for the skydome_light is controlled via skydome_light.samples, whereas the quality for a background sky is controlled via the GI_{diffuse|glossy}_samples. This subtle distinction is very important: skydome_light is direct lighting and sampled with shadow rays, whereas the background sky shader is indirect lighting and therefore sampled with GI Diffuse rays.

 

This scene uses a sky shader with a constant color which is sufficient to 'light' the scene with GI Diffuse rays. However, this is a rare example. It is generally recommended that you use a Sky Dome light to light an external scene.

 


 

 

  • No labels