Comping light passes
Right-click here to download the Nuke file

The basic idea here is to echo in our comp the way lighting works both in Maya and in the real world. In the real world a wall does not get a different color at sunset (say orange), rather the sun gets a different color. Similarly in Maya we would not change the textures on the wall, we would change the color of the light. However in composting when doing a day to night CC one would put a CC over the whole image. This is less physically accurate because we are changing the colors of everything. Instead we want to CC the light's color but not the texture colors. This gives us a more physically accurate result for our comp CC.

This is accomplished in comp by rendering out a rawLight pass, applying our color corrects to it, and then multiplying this with the diffuse pass which contains the flat texture colors. The comp formula looks like this:

RawLight x Diffuse = Lighting

With this formula we can then first CC the raw light element, and then recombine it with the diffuse like this:

            

However, there is an error in the RawLight pass that causes this not to combine properly. So we need to derive the RawLight ourselves in Nuke by reversing this equation:

Lighting ÷ Diffuse = RawLight

We can then insert our new RawLight into our above equation like this:

(Lighting ÷ Diffuse) x Diffuse = Lighting

This now combines correctly, and we can add in our CC node to the raw light and get a proper result in Nuke like this:

            

The reflection and refraction are built similarly, but using filter elements:

    Reflection ÷ ReflectionFilter = RawReflection
    (Reflection ÷ ReflectionFilter) x ReflectionFilter = Reflection

The full comp, divided in to direct and indirect lights, looks like this:

All content © copyright Light Collab.