Mar 2008

A Tapa of Tone Mapping with Footage

Tone mapped renders and Footage are usually treated separate and comped in Post , this setup is not the best option when we need to tweak our 3d elements to sit or blend with that footage.

From the moment we add the tone mapper in the lens shader slot of our camera, the background footage is treated and filtered as the rest of the objects in our scene, obviously we don’t want this to happen.
Though We have the option to compensate the effect of the tone mapper by tweaking the Image Plane node ,its not always an easy task.
There is a way around all this in Maya, it is not perfect solution, but works fine, it implies the use of render layers .We will make the same effect as a post-comp inside the render view in Maya, so every time we tweak the lighting or shading of our 3D objects the background wont be changed. It also works with constant or Surface shaded objects.
I will make a very simple example here

Lets have this image as our background:


Now lets add our 3d elements. Lets assume we want 3 Surface Shader spheres keep their colour values all the time as pure 100% R ,G or B, if we start lighting our character , converting the internal 32 bit render to the 8 bit framebuffer using a tone mapper like the mia_exposure_photographic, we can see how the colours of the spheres and background are affected:

Sin título
(Notice the dull sky and the wrong values of the spheres compared to the Hypershade swatches)
Lets make a correct setup:
We create 2 Render layers. First one with all the scene objects and a second one with only the objects we don’t want to be affected by the tone mapper (in this case the 3 RGB spheres). If we render the second layer alone we should have something like this:


Now we are going to make use of the Layer Override in Maya. Lets go to the camera and in the MentalRay create a Layer override in the lens shader slot. Now we can break the connection of this shader with the camera for this layer. If we render we have the footage and spheres untouched by the tone mapper, as we want:


Now, all we need to do is go to the Render layer with all the objects in it, go to the image plane and create another override in the display mode, make now the image plane not visible. Lastly and this only needs to be done if we are using constant or surface shader 3d objects (in our case the three spheres) override their shaders matte opacity to black.


From here we can start tweaking our light, shaders and tone mapper, the original footage and surface shaders of the spheres wont change.Once we finish, just render the main Render layer and make the final comp in Post.
As I pointed at the beginning its not perfect, mainly because the comp between layers is done un-premultiplied, still its easy to set up and most important, it lets us work with all the elements the way we want inside the Render view in Maya.

Finally, yes, this test example could have been easily done using traditional lighting techniques with no need of tone mapping.Its just an example.

Site Up

Ok this seems to be working, will update soon....