MR Using mia exposure simple

From TOI-Pedia


Tone mapping is used within Mental Ray to control the exposure settings of a camera. This enables you to adjust images that are either too dark or too bright.

The theory of Tone Mapping is covered in Mental Ray Tone Mapping. There are currently two tone mapping nodes available in Mental Ray:

  • mia_exposure_simple
  • mia_exposure_photographic

This tutorial covers the mia_exposure_simple node

The Tone Mapper can be set up in several ways:

  • Manually adding the mia_exposure_simple lens shader to your camera
  • Automatically when using the Create Physical Sun and Sky. It will be automatically set-up (be sure you create your render camera first!)

Setting up mia_exposure_simple manually

Open the Hypershade and go to the Cameras tab:

Hypershade cameras.jpg

Drag each of the cameras you want to use for rendering to the Work Area below using you middle mouse button (MMB).

Hypershade cameras in workarea.jpg

Now we're going to create the mia_exposure_simple node. This is a Mental Ray Node, so we need to switch the inventory at the left to Create Mental Ray Nodes:

Hypershade create mental ray nodes.jpg

Scroll to the Lenses section and open it. Click the mia_exposure_simple icon. A new node will be created and displayed in your Work Area:

Hypershade mia exposure simple in workarea.jpg

Now it's time to connect it to our cameras. MMB drag the mia_exposure node onto the camera icon and release your mouse button. A pop-up will appear asking you what type of connection should be created. Choose default in this case.

Mia exposure simple connected.jpg

That's it. The mia_exposure is now connected to your camera and can be used to adjust the rendered image. We'll keep the default settings for now. We will adjust them shortly.

You can repeat this process for other cameras. In most cases a single mia_exposure_control node will suffice, just connecting it to multiple cameras. In other cases you may want to create multiple mia_exposure nodes as well, allowing you to fine-tune per camera.

If you want to create an existing mia_exposure_simple node to one of your cameras, but your Work Area is empty, you can find existing mia_exposure_simple nodes in the Utilities tab. You can MMB-drag them into your Work Area to connect them.

If you want to see to which cameras a node is connected, select it and use the Hypershade show input output connections.jpg button to show its connections.


The mia_exposure-simple node can be accessed in several ways. The easiest way is through your Hypershade:

Mia exposure node in hypershade.jpg

Open the Utilities tab. You should find an overview of all mia_exposure nodes present in your scene. You can doucle-click the node or select it and open your Attribute Editor.

The mia_exposure_simple node has several settings. A brief overview:

offset for the entire range (darken or lighten the absolute black)
multiplication factor.
value above which the range should be compressed
compression ratio to squash the range that is compressed
gamma correction

For details on these settings, refer to Mental Ray Tone Mapper Settings.


Guidelines for mia_exposure_simple values:

pedestal: 0 (in most cases) gain: really depends on the range produced by Mental Ray. You need to find this by trying. knee: 0.5 - 0.75 compression: depends on the maximum values and the gain. A value between 0 - 20 seems reasonable. Consider lowering the knee value when compressions >20 are needed to get good results. gamma: 1.8 for more subtle images, 2.2 for more vivid images.

Exposure control and File textures

File textures may get washed out, because of incorrect gamma. By default, the mia_exposure_control applies gamma correction on the final image. Mental Ray expects file textures to be 'gamma neutral' (linear color space), which they are (probably) not. Chances are you've created them on a computer screen, which is normally in sRGB color space, with a gamma of 2.2. If the mia_exposure control corrects the final rendered image to the gamma you specified, the textures would get gamma-corrected again, which causes them to look washed out:

MR gamma correction off.jpg
MR gamma correction on.jpg

The left side shows a render without proper gamma correction, the right side shows the render as it is supposed to be, after proper gamma correction of the file textures.

The preferred solution: Enabling Color Management in Maya and setting the gamma value of your mia_exposure node to 1.0.

Alternatively you could fix the problem without using color management:
  • You could change the Mental Ray internal framebuffer gamma and the Exposure control gamma,
  • or you could gamma-correct each file texture using the Gamma Correct node in the Hypershade.

The first method is the easiest to implement:

  • Open you Render settings, Quality tab. Find the Framebuffer section and open the Primary Framebuffer subsection. Set the gamma to 1/desired gamma, so 1/2.2 = 0.4545 for a end-result gamma of 2.2
  • Set the Gamma of your mia_exposure_simple or mia_exposure_photographic to 1.00.

The second method involves creating Gamma Correct nodes in the Hypershade for each file texture and setting it to 1/2.2: 0.4545 for each color channel. This process can be automated using the MR Gamma correction MEL script. This will add gamma correction nodes to all file textures, counter-correcting them for the specified gamma, so the end result should look good.

Personal tools