Photographic Exposure (mia)

 
 
 

| Render Tree Usage

Category: Lens

Shader Family: Lens

Output: Color

Related mental ray shader: mia_exposure_photographic

This shader is a tone mapper that converts actual pixel luminances (in candela per square meter) into image pixels as seen by a camera, applying camera-related parameters (such as f-stops and shutter times) for the exposure, as well as applying tone mapping that emulates film and camera effects.

The shader has two basic modes:

If the Film Speed (ISO) parameter is non-zero, the photographic mode is used, and if it is zero, the arbitrary mode is used.

Name

The shader's name. Enter any name you like, or leave the default.

Film Settings

In photography, the film speed (the ISO value), the aperture (f-number) and shutter time all interact to define the actual exposure of the camera. Therefore, to modify the exposure you could modify each of them to achieve the same result. For example, to make the image half as bright, you could halve the shutter time, halve the ISO of the film, or change the aperture one "stop" (for example from f/16 to f/22). In a real world camera there would be subtle differences between these different methods, but with this shader they are mathematically equivalent.

Film Speed (ISO)

Specifies the ISO number of the film, also known as "film speed".

As described above, if this is set to zero, the arbitrary mode is enabled and all color scaling is then strictly defined by the value of cd/m^2 Factor.

Shutter Time Ratio

The camera shutter time to be expressed in fractional seconds. For example, the value 100 means a camera shutter speed of 1/100. This value has no effect in arbitrary mode.

f-Stop Number

The fractional aperture number. For example, 11 means an aperture of f/11.

Aperture numbers on cameras are expressed in specific standard series: f/8, f/11, f/16, f/22, etc. Each of these are referred to as a "stop" (from the fact that aperture rings on real lenses tend to have physical "clicks" for these values) and each such "stop" represents half the amount of light hitting the film at each increased "stop". It is important to note that this shader doesn't count "stops", you must give it the actually f-number for that stop. This value has no effect in arbitrary mode.

Whitepoint

A color that will be mapped to "white" on output. For example, an incoming color of this hue/saturation will be mapped to grayscale, but its intensity will remain unchanged.

Vignetting

In a real camera the angle with which the light hits the film impacts the exposure, causing the image to go darker around the edges. The vignetting parameter simulates this effect.

When 0.0, vignetting is off, and higher values cause stronger and stronger darkening around the edges. Note that this effect is based on the cosine of the angle with which the light ray would hit the film plane, and it is affected by the field-of-view of the camera, and will not work at all for orthographic renderings. A good default is 3.0, which is similar to what a compact camera would generate.

cd/m^2 Factor

In photographic mode (a non-zero film speed) this is the factor used to convert between pixel values and candela per square meter.

In arbitrary mode (a zero film speed), this factor is a multiplier applied when scaling rendered pixel values to screen pixels. This is analogous to the Gain parameter of the Simple Tone Mapping (mia) shader.

Tone Mapping

The parameters Allowed Overexposure and Allowed Underexposure guide the actual "tone mapping" of the image. That is, they specify exactly how the high dynamic range imagery is adapted to fit into the black-to-white range of a display device.

If Allowed Overexposure is one and Allowed Underexposure is zero, the transfer is linear and the shader behaves like a simple linear intensity scaler only.

Allowed Overexposure

Defines how much over-exposure is allowed.

As it is decreased from 1 towards 0.0, high intensities will become more and more "compressed" to lower intensities. When it is 0.0, the compression curve is asymptotic, which means an infinite input value maps to a white output value, and overexposure is no longer possible. A good default value is 0.5.

Allowed Underexposure

When the upper part of the dynamic range becomes compressed it naturally loses some of its former contrast, but you can get some of that "punch" back into the image by using the Allowed Underexposure parameter.

When 0.0, the lower intensity range is linear, but when raised towards one, a strong "toe" region is added to the transfer curve so that low intensities gets pushed more towards black, but in a gentle (soft) fashion.

Saturation

Compressing bright color components inherently moves them towards a less saturated color. Sometimes, very strong compressions can make the image look unappealingly washed out. The Saturation parameter provides artistic control over the final image saturation. 1.0 is the standard unmodified saturation, higher values increase the saturation and lower values decrease the saturation.

Gamma

Applies a display gamma correction. Be careful not to apply gamma twice in the image pipeline.

Side Channel

Supports the case where you want to insert an output shader prior to the conversion to "display pixel values".

This is accomplished by applying two copies of the shader, one as lens shader, the other as an output shader. The two shaders communicate via the "side channel", which is a separate floating point framebuffer that needs to be set up prior to rendering. See Render Channels & Framebuffers [Rendering].

Side Channel Mode

  • Normal (No side channel): The shader is run normally as a lens shader.

  • Process side channel in output shader: The lens shader saves the un-tonemapped value in the side channel framebuffer. Then the output shader re-executes the tone mapping based on the data in the side channel, not the pixels in the main framebuffer.

  • Process side channel into main buffer in output shader: The lens shader saves the un-tonemapped value in the side channel framebuffer. Then the output shader reads the pixels from the side channel framebuffer back into the main framebuffer. This is useful when you want to run a third party output shader that only runs on the main framebuffer.

[side channel]

Select a custom render channel to act as the side channel.

Add...

If you have not created a custom render channel yet, then click the Add button and enter a name for the render channel. The render channel is automatically added to the scene's Available Channels grid using the appropriate data type for the output. See Creating a Custom Render Channel for the Scene [Rendering].

You will also have to add the render channel to the pass and set the pass options in order to render the output. See Adding a Render Channel for the Pass [Rendering].

Preview

Use Preview

Makes the process of tweaking the tone mapper more interactive by allowing you to preview the results.

To tweak the tone mapping using a preview image, do the following:

  1. Disable the Photographic Exposure shader.

  2. Render the image to a file in an HDRI capable format (such as *.exr, *.hdr, etc.) and name it, for example, preview.exr.

  3. Add the preview image to the scene as an image clip and source. For more information, see Creating Sources and Clips [Data Management].

  4. Enable the Photographic Exposure shader again.

  5. In the render tree, get the preview image from the Clips menu and connect it to the shader's preview input port.

  6. Select the Use Preview checkbox.

  7. Disable any photon mapping or final gathering.

  8. Re-render. The rendering will be nearly instant, because no actual rendering occurs at all: the image is read from the preview file and is immediately tone mapped to screen.

  9. Tweak the parameters and render again until you are satisfied with the results.

  10. Re-enable any photons or final gathering.

  11. Turn off Use Preview.

  12. The shader is tuned and ready for final output.

Render Tree Usage

This shader can be applied directly to the camera in the lens shader stack. See Applying Lens Shaders to Cameras [Cameras and Motion Blur].

It is also used with the Physical Sky and Physical Sun shaders when you run the Initialize Sky Shader plug-in — see Creating the Physical Sky Shader Setup for more information.