66 3 Sun <strong>and</strong> Skya bounding box in the coordinate system of the light within which photons are aimed.This can be used to “focus” GI photons on a particular area-of-interest. For example, ifone has modelled a huge city as a backdrop, but is only rendering the interior of a room,<strong>mental</strong> <strong>ray</strong> will by default shoot photons over the entire city <strong>and</strong> maybe only a few willfind their way into the room. With the photon bbox max <strong>and</strong> photon bbox minparameters one can focus the photon emission of the mia physicalsunto only aim atthe window in question, greatly speeding up <strong>and</strong> enhancing the quality of the interiorrendering.• automatic photon energy enables automatic photon energy calculation. When thisis on, the light source does not need to have a valid energy value that matches that ofthe sun (it does, however, need a nonzero energy value or photon emission is disabledby <strong>mental</strong> <strong>ray</strong>). The correct energy <strong>and</strong> color of the photons will be automaticallycalculated. If this parameter is off, the photons will have the energy defined by thelights energy value.• If illuminance mode is zero, the default solar intensity used (calculated internallybased on the haze, solar angle, optical airmass, etc.) which is compatible with previousversions of the library. If illuminance mode is 1, the sun light will have the directnormal illuminance (in lux) set by the direct normal illuminance parameter. Thecolor of the sunlight is still driven by the haze as before, only the intensity is modified.3.6 Sky ParametersThe mia physicalsky shader is responsible for creating the color gradient that represent theatmospheric skydome, which is then used to light the scene with the help of Final Gathering<strong>and</strong>/or sky portals (page 71). The mia physicalsky, when used as an environment shader, alsoshow the sky to the camera <strong>and</strong> in reflections.mia physicalsky also creates a virtual ground plane that exists “below” the model. This makesit unnecessary to actually model geometry all the way to the horizon line - the virtual groundplane provides both the visuals <strong>and</strong> the bounce-light from such ground.declare shader "mia_physicalsky" (boolean "on"default on,scalar "multiplier" default 1.0,color "rgb_unit_conversion" default 0.0001 0.0001 0.0001,scalar "haze" default 0.0,scalar "redblueshift" default 0.0,scalar "saturation" default 1.0,scalar "horizon_height" default 0.0,scalar "horizon_blur" default 0.1,color "ground_color" default 0.2 0.2 0.2,color "night_color" default 0 0 0,vector"sun_direction",
3.6 Sky Parameters 67light"sun",# The following parameters are only useful# when the shader is used as environmentscalar "sun_disk_intensity" default 1.0,scalar "sun_disk_scale" default 4.0,scalar "sun_glow_intensity" default 1.0,boolean "use_background",shader "background",# For the lens/volume shader modescalar "visibility_distance",boolean "y_is_up",integer "flags",integer "sky_luminance_mode" default 0,scalar "zenith_luminance" default 0.0,scalar "diffuse_horizontal_illuminance" default 0.0,# Perez model luminance distribution parametersscalar "a",scalar "b",scalar "c",scalar "d",scalar "e",)boolean "physically_scaled_sun"version 5apply environment, texture, lens, volumeend declare• on turns the shader on or off. The default is on.• multiplier is a scalar multiplier for the light output. The default is 1.0.• rgb unit conversion allows setting the units, described in more detail above. Thespecial value of 0 0 0 matches 80000 lux (light level on a sunny day) to the output value1, suitable for low dynamic range rendering.• horizon height sets the “level” of the horizon. The default value of 0.0 puts the horizonat st<strong>and</strong>ard “height”. But since the horizon is infinitely far away this can cause troublejoining up with any finite geometry that is supposed to represent the ground. It can alsocause issues rendering locations that are supposed to be at a high altitude, like mountaintops or the top of New York skyscrapers where the horizon really is visibly “below” theviewer.This parameter allows tuning the position of the horizon. Note that the horizon doesn’tactually exist at any specific “height” in 3D space - it is a shading effect for <strong>ray</strong>s that