Join Brian Bradley for an in-depth discussion in this video Adding mental ray sun and sky to a scene, part of Learning mental ray in Maya.
- The Mental Ray Sun and Sky system in Maya can be used to create a complete and realistic looking daylight simulation with parameters that give us control over almost every aspect of lighting and the environment setup. To add a Mental Ray Physical Sun and Sky system to our scenes, all we need to do is open up the Renders Setting dialogue and in the Indirect Lighting tab, click the Create button for the Physical Sun and Sky option. In the Attribute Editor, the options for the MIA Physical Sky node become active and in the scene, we're ready to render with a full daylight simulation system in place.
It really is as easy as that. The system we have created consists of standard directional light with a physical sun shader override applied, that sits in the scene and controls the directional light of the sun itself. Whilst the MIA Physical Sky environment which has been attached to our camera as an environment shader, takes care of sky lighting. The actual position of our directional light in a scene doesn't for all intents and purposes really matter as positional information doesn't play any part in controlling light direction.
This is all handled by the light's rotation settings, meaning we could happily leave our light object right where it is at this moment in time and start to tweak our lighting setup by means of rotational values alone. Personally though, I always prefer to place any lights that I have in the scene in a manner that gives me instant visual feedback regarding both the direction and angle from which the light, the sun in this instance, will be coming. To do that here, let's over in the outliner, select the Sun Direction node from down at the bottom of the list, make certain that we are in the Sun Shape tab in the Attribute Editor and then in the Object Display roll out, set our direct lights Locator Scale to something like 3,000.
This just makes it much easier to both see and select in the scene. We can now turn on the light's manipulator by using either the icon found on the general shelf or as I will here, by simply hitting the T key. Now the first thing I want to do is grab the target manipulator in the viewport this is the small empty [mumbles] square and move it down in the view, just enough to reveal the light manipulator itself sitting just behind which I can then grab and move up toward the top of our building here.
We will be tweaking our sun position some more in this view in a little while but this will do in a starting position. If preferred, we can now place the target manipulator back at ground level, although given that this won't make any noticeable difference to our final lighting result, I'm just going to leave things as they are for now. Next we want to come to the viewport's panel menu and from the Orthographic camera's fly out, choose the custom cam top option that we have already setup in the scene. This is a straight copy of the default top view orthographic camera but one that has in this instance, been raised much higher in the scene so as to avoid clipping plane problems with our at scale geometry.
From this view, we can now place our directional light in the small gap between the two buildings sitting in the back here. When we're done, we can switch back to our main camera view. Now this move has in fact placed our sun in more or less in the final position that we want but let's tweak it a little so that it sits just at the top or tip of the 6th ring, counting from the floor upward just in between the two main towers. Now if we want to see what kind of shadow this is going to produce in the scene, we can of course, turn on Lights and Shadows from the viewport and then fine tune our light's position for maximum effect.
With all of that done, we can take a render in order to see what we have created so far. Probably the first thing we will notice is that our render is looking quite washed out. This is being caused by the fact that when we created the physical sun and sky, Maya, behind the scenes, applied an MIA exposure simple node to the viewing camera as a Lens Shader which if I just select in order to jump into it's options, we can see is in fact applying a 2.2 Gamma correction to our render in addition to the SRGB color correction already being applied in the render view by Maya's Color Management systems.
To have things render correctly then, we will need to set the Gamma value here to 1.0 and then we can render again. What we get from Mental Ray now does indeed look like a fairly decent daylight simulation given the angle and position of the sun in the sky. Now of course, we are only using Mental Ray's default final gather and image sampling settings here. So things have plenty of room for improvement quality wise. Even so, focusing on just the lighting created we can see that we have definitely added a very natural looking daylight solution to the scene without really having done too much work at all.
Of course Mental Ray being the renderer that it is, adding a sun and sky system to the scene is only the tip of the iceberg with regard to the control, overseeing lighting and so ultimately scene mood that we have available. In our next video then, we're going to take a look at the controls available for the physical sun aspect of this daylight system.
- Workflow recommendations
- Controlling the physical sun and sky lighting systems
- Applying an exposure shader
- Using Final Gather
- Working with Diffuse, Refractive, Reflective, and Translucent materials
- Working with MILA materials
- Controlling render quality with image sampling
- Creating a motion blur effect
- Working with displacement mapping
- Using proxies