mia_exposure_photographic
 
 
 

Category: mental ray > Lens

Shader Family: Lens

Output: Color

Related Softimage shader: Photographic Exposure (mia)

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.

cm2_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 mia_exposure_simple shader.

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.

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_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.

camera_shutter

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_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.

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.

Tone Mapping: The parameters burn_highlights and crush_blacks 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 burn_highlights is one and crush_blacks is zero, the transfer is linear and the shader behaves like a simple linear intensity scaler only.

burn_highlights

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.

crush_blacks

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 crush_blacks 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.

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

Enter the name of the custom render channel to act as the side channel.

For information on how to do this, see Creating a Custom Render Channel for the Scene. 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

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

  1. Disable the mia_exposure_photographic 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.

use_preview

Enables a preview image which makes the process of tweaking the tone mapper more interactive by allowing you to preview and edit the results.