mia_physicalsun

 
 
 

Category: mental ray > Light

Shader Family: Light

Output: Color

Related Softimage shader: Physical Sun (mia)

This shader is intended to be used together with the mia_physicalsky shader to enable physically plausible daylight simulations and accurate renderings of daylight scenarios.

The Physical Sun shader determines the color and intensity of the sunlight, as well as emitting photons from the sun. The shader should be applied as a light shader and photon emission shader on a directional light source (it does not work on any other light type).

Some parameters exist in both the Physical Sun and Physical Sky shaders and all do the same thing. For physical correctness, you need to keep these parameters in sync with each other in both shaders. For example, a sun with a different haze value than the sky cannot be guaranteed to be physically plausible. The most important common parameters are those that drive the entire shading and colorization models: Haze, Red-Blue Shift, and Saturation.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

on

Activates this shader.

multiplier

A scalar multiplier for the light output. The default value is 1. You might want to turn down the multiplier to something like 0.01 as the default value is somewhat strong.

rgb_unit_conversion

Converts the output to something other than true photometric units. If this value is 1 1 1, both the values returned by the mental ray shader API functions mi_sample_light (for the sunlight) and mi_compute_avg_radiance (for the skylight), when sent through the mi_luminance function, will numerically match photometric values in lux.

Since the intensity of the sun outside the atmosphere is calibrated to 127500 lux, this is very bright when seen compared to a more classic rendering, where light intensities generally range from 0 to 1. The RGB Unit Conversion parameter is applied as a multiplier and should be set to a value below 1 (such as 0.001 0.001 0.001) to convert the raw lux value to something more manageable.

For convenience, the value of 0 0 0 is internally set so that 80000 lux (approximately the amount of light on a sunny day) equals the classic light level of 1.

haze

Sets the amount of haze in the air. The range is from 0 (a completely clear day) to 15 (extremely overcast or like a sand storm). The haze influences the intensity and color of the sky and horizon, intensity and color of sunlight, softness of the sun's shadows, softness of the glow around the sun, and the strength of the aerial perspective.

redblueshift

Controls the redness of the light. The default value of 0 is the physically correct value, but you can change that with this parameter. The range is from -1 (extremely blue) to 1 (extremely red).

saturation

Controls the saturation, where 1 is the physically calculated saturation level. The range is from 0 (black and white) to 2 (extremely boosted saturation).

Note: If you are using an HDR background, you can set the Saturation to zero because you probably don't need the "sun color".

horizon_height

Sets the level of the horizon. The default value of 0 puts the horizon at a standard height, but you may need to change this to accommodate different rendering locations, such as the view from the top of a mountain or skyscraper.

The horizon doesn't actually exist at any specific "height" in 3D space — it is just a shading effect for rays that go below a certain angle, which you can change with this parameter. The total range is from -10 (the horizon is straight down) to 10 (the horizon is at the zenith), but smaller values are more useful; for example, -0.2 pushes the horizon down just below the edge of a finite visible ground plane.

This parameter affects not only the visual representation of the horizon in the Physical Sky shader, but also the color of the Physical Sun itself.

shadow_softness

The softness level for soft shadows. A value of 1 matches the softness of real solar shadows most accurately. Lower values makes the shadows sharper, while higher values make them softer.

samples

The number of shadow samples for the soft shadows. If set to 0, no soft shadows are generated.

Photon Bounding Box: When photon_bbox_min and photon_bbox_max are left set to 0,0,0 the photon bounding box will be calculated automatically by the shader. If these options are set to a non-zero value, they define a bounding box in the coordinate system of the light within which photons are aimed. This can be used to "focus" global illumination photons on a particular area-of-interest. For example, if you have modelled a huge city as a backdrop, but you are only rendering the interior of a room, mental ray will by default shoot photons over the entire city and maybe only a few will find their way into the room. With the photon_bbox_max and photon_bbox_min parameters you can focus the photon emission of the mia_physicalsun to only aim at the window in question, greatly speeding up and enhancing the quality of the interior rendering.

photon_bbox_min

Defines the bounding box minimum in the coordinate system of the light within which photons are aimed.

photon_bbox_maax

Defines the bounding box maximum in the coordinate system of the light within which photons are aimed.

automatic_photon_energy

Enables the automatic calculation of energy and color of the photons. When on, the light source does not need to have a valid energy value that matches that of the sun (however, it needs a non-zero energy value or else photon emission is disabled by mental ray). When off, the photons have an energy as defined by the light's energy value.

y_is_up

Defines what constitutes "up". In Softimage, the Y axis is "up" and this parameter should be on.

illuminance_mode

If illuminance_mode is 0 (zero), the default solar intensity is used (calculated internally based on the haze, solar angle, optical air mass, etc.).

If illuminance_mode is 1, the sun light will have the direct normal illuminance (in lux) set by the direct_normal_illuminance parameter. The color of the sunlight is still driven by the haze as before, only the intensity is modified.

direct_normal_illuminance

Specifies the direct normal illuminance (in lux) of the sunlight when the illuminance_mode is set to 1.

Render Tree Usage

This shader is intended to be used together with the mia_physicalsky shader. You can also use it in conjunction with the shader mia_material.

This shader is applied to a directional light that represents the sun, and the mia_physicalsky shader is used as the scene's camera environment shader. The environment shader should be used to illuminate the scene with the help of final gathering, and bounced light from the sun can be handled either by final gathering diffuse light that is bounced or via global illumination (photons).

Connect this shader to the Light node's Light Shader input.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License