This can be really handy if you want this sort of realism, but in a lot of cases it's nice to retain artistic control over these colors and values. It is possible to use a custom mental ray environment instead of Physical Sky to do this, but there are also a lot of other ways to tweak and edit when using Physical Sun and Sky, which was enough for me to get what I wanted in this scene. I'll go into more detail on this later.
Add MR Light Portals to the Windows
Because the Physical Sun and Sky system is designed primarily to deal with lighting outdoor scenes, I have to take a couple of steps to make it work nicely for an indoor scene.
Luckily, mental ray offers a nice solution to deal with this problem, the mia_portal_light. The portal light node basically tells mental ray that I am intending to place a light source to represent a window, and in conjunction with Physical Sun and Sky it helps to simulate the effect of indirect sky lighting. Because I've already added some area lights for the windows during the lighting block out earlier, I can use them as light portals.
To do this, I select an area light and open the Attribute Editor. I then scroll down to the mental ray rollout menu and expand it. The two sections I am interested in are the Area Light and Custom Shaders options.
Firstly, in the Area Light rollout, I check the Use Light Shape option.
Now I switch to the Custom Shaders rollout and plug the mia_portal_light node into the Light Shader of the area light. I click on the checkered box next to the Light Shader section, and in the menu that appears I click on mental ray lights in the left side section to find the mia_portal_light node. Once this is plugged in I am given a set of options for the light portal, but for now I leave these as the default values as I'll deal with them more in the tuning and balancing section.
Now I repeat the process for the other windows in the scene.
Fig.11 shows the effect when I changed the area lights into portal lights. It doesn't look particularly different to the previous render, but it's actually much more balanced and also easier to change the settings.
Back to Linear Workflow
Now I have an indoor scene lit with realistic sun and sky lighting coming in through the windows. The next stage is to finish setting up the linear workflow so that I am then ready to begin some artistic tweaking of the lighting.
Fig.12 shows my image before addressing linear workflow. The light doesn't seem to bounce in a natural way, making the room and astrosphere overly dark. I can address this by conducting the following steps.
There is one node that the Physical Sun and Sky system created that I haven't mentioned yet: the exposure node connected to the camera. I select the camera being used to render the scene and take a look at the Attribute Editor. Here, I can see that there is a node named mia_exposure_simple1. I click on the tab for this node and take a look at the values. The gamma has been automatically set to 2.2, which means that after mental ray finishes a render, the exposure node corrects the gamma value so that my monitor can show me accurate lighting values as the renderer views them.
This would work fine if I was only dealing with raw lighting, but it's not so good when using textures maps prepared in another program, such as Photoshop. If I render the scene now, I can see that all the textures look overly white and washed out (Fig.13). This is because they are receiving a "double” gamma correction.