mia_exposure_simple
 
 
 

Category: mental ray > Lens

Shader Family: Lens

Output: Color

Related Softimage shader: Simple Tone Mapping (mia)

When rendering physical light levels, problems can occur with managing the HDRI output of the real physics vs. the limited dynamic range of computer monitor displays. One method to deal with this to create visually pleasing results is known as tone mapping.

The mia_exposure_simple shader is a simple tone mapper. It simply adds a knee compression to "squash" overbrights into a manageable range. This shader takes the high dynamic range color and performs these operations in this order:

  1. The Pedestal parameter value is added to the color.

  2. The color components are then multiplied by the Gain parameter value.

  3. The resulting colors are checked if they are above the Knee parameter value.

  4. If they are above this value, they are "squashed" by the Compression ratio value.

  5. Finally, Gamma correction is performed.

Name

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

pedestal

Allows you to tweak the equivalent of the "black level". A positive value adds some light so even the darkest black becomes slightly gray. A negative value subtracts some light and lets you create more contrasting effects.

gain

Controls the overall brightness. This is the main point where the high dynamic range values are converted to low dynamic range values. For example: if you know that the approximate range of color intensities goes between 0 and 10, the gain value should be approximately 0.1 to get the larger color intensity range in the desired range of 0 to 1.

However, since the point of tone mapping is not to blindly scale the range down, simply setting it to 0.1 will most likely yield a dark and boring image. A more likely value is 0.15 or even 0.2, but a value of 0.2 maps the 0-to-10 range down to 0 to 2. To deal with what's above 1, you need to use compression.

knee

The point where the overbrights begin to get "squashed". Since this is applied after gain, it should be in the range of 0 to 1. A useful range is 0.5 to 0.75.

compression

Compresses the overbrights. If you set this to 0.75, any color (after having pedestal added and multiplied by gain) that comes out above 0.75 is compressed. A value of 5.0 is fairly strong compression; 0 is no compression.

gamma

Corrects the resulting compressed color for the output device (such as the computer screen).

preview

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

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