Lighting La Salle Chapter 1: Sunset/Sunrise
Take a sneaky peak into the first chapter of one of 3DTotal's groundbreaking eBooks in this short sample tutorial. If you would like to build upon what you learn in the following article or if you would like to continue to follow this tutorial you can purchase the full eBook in the 3DTotal shop.
Please note: This eBook includes free resources, which can be obtained by purchasing the full product by clicking the banner above.
Some distinct characteristics of a "Sunset" condition are the very long and soft shadows, with burnt yellow colors on directly lit areas.
Most objects affected by the sun rays at this time of the day appear to have a "rim" of burnt yellow color that propagates towards brighter hues of yellow.
Also, due to its low intensity, the overall environment is somewhat darker.
This phenomenon occurs mainly due to the earth's position at that particular time of the day.
Mental ray is equipped with all the necessary tools to emulate the above mentioned effects.
Let's start by opening the Max file.
Next, open the "render setup" dialog box (press F10).
In the "common "parameters rollout, pan down to the "assign renderer" rollout and click on the "production" toggle to load the "mental ray renderer". Choose it and close the dialog box. (Fig.01)
Note that the system's unit setup is already set to meters, and the rendering output size to 500x234 pixels. With the image and pixel aspect locked.
The camera position is also set and locked.
Next, we are going to create the daylight system, to set the shadow directions.
Make sure you have all four of the viewports available so you can have full control of the daylight system creation.
Create the daylight system by first clicking on the "create" main tool bar.
On the dropdown list, choose lights, followed by daylight system.
The daylight system creation dialog box should be prompted. Accept it, followed by left clicking and dragging the cursor to start the creation.
On releasing the mouse to complete the compass creation, the mental ray sky dialog should be prompted. Accept it to continue the creation.
Continue the creation by moving the cursor up or down to set the distance of the daylight object from the compass helper.
Once satisfied, simply left click to finish the creation. Click the "select and move" tool from the toolbar to complete and exit the creation. (Fig.02a and Fig.02b)
Note that, the" mr exposure" and "mr sky" dialogs will not appear if both of these toggles are not empty.
Now we have the daylight system created we can begin setting the shadow directions.
Prior to that, we are going to disable the final gather, for quick rendering results, and enable the hardware shadings function.
Convert the camera viewport from box visual style to smooth + highlights mode.
Click on its icon; on the dropdown list, choose the "lighting and shadows" function, followed by "enable hardware shading". (Fig.03)
Next, select the daylight system object and open the "modify" command parameters.
By default its position is set to "date, time and location". Change it to "manual", and begin moving around the daylight system object.
The sun shadows should be considerably long and of "burnt yellow" colour, to resemble a sunset. (Fig.04a and Fig.04b)
If you are experiencing difficulties with your graphics card, simply disable the hardware shadings function, and click render (Shift + Q), to see the results.
The shadow position seems ok now. The next step is to use a basic material override color to further tweak the daylight system's color and intensity.
Enable the final gather and open the material editor (M).
Select the basic "wall (pearl finish)" material slot, from the "material editor".
This shader has the "ambient/reflective occlusion (3dsmax)" applied to its diffuse toggle.
On the "render setup" dialog, open the "processing" rollout and enable the "material override" function.
Back on the "material editor", drag and drop the "wall (pearl finish)" onto the "material override toggle. Choose the "instance" copy method, on the "instance (copy) material" dialog. (Fig.05)
Click render (Shift + Q) to assess the changes.
Accept to "continue" in the "missing map coordinates" dialog.
The render seems a bit dark still. In the "indirect illumination" rollout; Increase the Final Gather "diffuse bounces" to 1.0.
Open the "environment and effects" dialog (8), choose the "physically based lighting, indoor daylight" preset, from the "mr photographic exposure control" list.
Enable the "photographic exposure" function, and set the "shutter speed" to about 90.0.
Increase the "shadows" function to about 1.0. This will invigorate the shadows.
In the "image control" group, increase the "whitepoint" value to about 9500.0. Note that this value worked best to capture the white points in the scene.
In the Physical scale group, enable the "unitless" function, and set it to about 120000.0.
Values between 90000.0 and 120000.0 work best.
While the daylight object is still selected, open the "modifier" command and increase the "mr sun basic parameter" "multiplier" to about 4.0.
The sun's color at sunset is yellowish; to emulate this, disable the "inherit from mr sky" function first.
In the "nonphysical tuning" group, increase the "red/blue tint" value to 0.4(equal to a yellowish/reddish colour). Also Increase its "saturation". To about 1.5 then test render it. (Fig.06)
The next step is to decrease the sky horizon height and change its color to a stronger blue (next to the windows).
Pan down to the "mr sky advanced parameters" rollout; and bring down the horizon line by decreasing its "height" to -1.5.
To change the sky's colour to a stronger blue, in the "non-physical tuning" group, decrease its "red/blue tint" value to -0.32. Then test render it again. (Fig.07)
The next stage is to add portal lights and a "fill" light in the foreground, to help improve further the overall illumination in the scene.
Select the top viewport. On the create command, open the "photometric light" set.
Click and drag the target light from the object type group to the front viewport, to create it. (Fig.08)
The principle is to create a nice diffused light to emulate light bounces around the designated area.
The first step is to change some of its default settings.
Now that the light direction is set, disable the "targeted" function, in the "general" parameters.
This will provide more flexibility when moving/ placing lights in the scene.
Change the "shadows" type to "ray traced shadows", in the "shadows" group dropdown list.
Ray traced shadows work best with mental ray.
In the "light distribution" type group, change it from "spotlight" to "uniform spherical"; to spread out the distribution of light.
In the "intensity" type, change it to dimming. This function will help control the light intensity.
Select and move up the light, near the camera's height (i.e. 1.186m).
Also, open the "mental ray message window", to monitor the rendering process.
Finally, change the "emit light from" function from "point" to "rectangle" type. Rectangle type is highly recommended to control the softness of the shadows (i.e. higher values of length/width= softer shadows). Test render. (Fig.09 and Fig.10)
The scene is still a bit dark; increase its "dimming resulting intensity" values to about 1700.0. Then test render.
The scene now looks much brighter and balanced. Also, the burnt yellow rims around the sunlight's highlights are more apparent now. This phenomenon occurs mainly when the sunlight position is very low.
If desired, one can Increase the photometric light's length/width rectangle values, to diffuse the shadows further.
The next phase is to add portal lights close to the windows, to emulate diffused shadows from the skylight.
Select the front viewport. On the create command, open the photometric light set.
Click and drag the "mr sky portal" from the object type group to the front viewport, to create it. (Fig.11)
The next step is to place this "mr sky portal" light close to one of the windows (move+ rotate)and change some of its core parameters.
Prior to start selecting and moving lights, it's worth enabling the lights "selection filter" from the main toolbar, to facilitate light selections.
Move/rotate and place the "mr sky portal" close to the left window.
Increase its width/length dimensions to fit the window's size.
Since this "mr sky portal" is being created mainly to emulate the diffused shadows, decrease its multiplier value to about 0.5.
Also, change its filter color to match the skylight.
Enable the "use existing skylight" function to closely match the skylight color.
Change the shadow samples to 32, to reduce the noise/speckles caused by its shadows in the scene (note that the value of 32 will increase the rendering time slightly however, since the sky portal multiplier value is low, it may balance things).
"Copy instance" the "mr sky portal" from the left window, to the right window.
Finally, just copy and move the third and last "mr sky portal". Place it behind the front window and match its dimensions. The renders should now look much better. (Fig.12a and Fig.12b)
With most lights added it is now the appropriate time to add a nice environment image to the background.
A bitmap will be used in conjunction with the current environment's "mr physical sky" shader.
This shader is very good in capturing the true essence of the daylight position.
For example, if the daylight position is low, the "mr physical sky" will add the burnt yellow rim light around the bitmap pixels...which is a very distinctive of the sunset lighting condition.
Open the "material editor "(M) and the "environment and effects" dialog(8).
Drag and drop the "mr physical sky" toggle onto a slot in the "material editor" dialog.
Accept the "instance copy" method. (Fig.13)
Its parameters should load up.
Next, we are going to insert a bitmap in its "haze" toggle.
Disable the "inherit from mr sky" function. It's enabled by default, to link its parameters with "mr sky object" in the scene. Disabling it will break this connection.
To add a bitmap to the sky click on the "haze" toggle.
In the "material/map browser" dialog choose the "bitmap" option from the list, and "ok" to close it.
Pick the "outside Big_brighter".jpeg bitmap.(Fig.14a and Fig.14b)
The bitmap and its parameters should load up. Its default parameters are set to "use real-world scale". For better control of most parameters, one has to disable it, by first selecting the "texture" mapping type and disabling the "use real-world scale" function.
Next, change the mapping "environment" type. (Fig.15)
To quickly tile and centre the environment bitmap correctly behind the windows, we are going to first select and isolate parts of the window area in the scene.
Select and isolate the selected areas around the window area then test render to assess the bitmaps position in the environment.
The bitmap doesn't seem to be visible yet; also, the horizon line is not matching with the mr sky object (i.e. -1.5).
In the material editor, pan down to the "output" rollout and increase the "RGB level" value to 10.0 then test render it again. One can also disable the FG process to speed up the rendering times, if desired. (Fig.16 and Fig.17)
To change the horizon line position; click on the "go to parent" button first, to go back to the main "mr sky" parameters.
In the "mr sky" parameters, increase the "multiplier" value to about 1.5, to brighten up further the environment map.
In the "horizon and ground" group, match the "horizon height" to mr sky object (i.e. -1.5). This function will subsequently reveal more areas of the bitmap.
Finally, to add a bit of a yellowish/reddish tint to the sky, go to the "non-physical tuning group and increase the "red/blue tint" value to 0.3 then test render the results.
Back in the "haze" bitmap's "coordinates" rollout. Change the mapping from "spherical environment" to "screen" type.
Moreover, through quick test renderings increase the "V" "offset" value from 0 to 0.63; the "U" "tiling" to 2.0 and "V" to 0.3. The environment bitmap should be more visible and centralized now.
Next, we are going to fine-tune its appearance in the environment with the "ouput" curves. (Fig.18a and Fig.18b)
Pan down to the "output" rollout and check the "enable color map" function.
Click on the "add point" point button, to add curve points. Tweak and add more points whilst test rendering, to assess the changes. (Fig.19)
Note how the areas of the environment bitmap close to the sun disk have a rim of reddish/yellowish color around its pixels. To help accentuate this effect, go back to the main "mr physical sky" parameters. In the "sun disk appearance" group, increase the disk and glow intensity values to about 25.0.
Next, we are going to test render without the "material override", and set up for the final render.
Disable the "material override" function, in the render setup "processing" rollout.
Enable the FG process and test render. (Fig.20)
The render is looking reasonably ok now. The next stage is to save up the final gather files and send the final high resolution render.
With the FG saved, mental ray will bypass the FG process and concentrate mainly on rendering. This will subsequently reduce the rendering times dramatically. It is highly commended to use one computer only, when executing this task.
Once saved, one can then use multiple computers to reuse the pre-saved FG file to render the image.
Mental ray is very powerful and efficient in enabling users to save the FG file at a small output resolution (i.e. 320x240), and later reuse it for your final high resolution (i.e. 5000x3750), without artifacts.
Note that, the camera view, image and pixel aspect output size need to be locked beforehand.
Moreover, when network rendering, it's vital to have this pre-saved FG file in a location where other computers can "see" it and reuse it.
With the camera view, image and pixel aspect output size locked, we can now begin setting up the final FG parameters.
On "render setup" dialog, under "indirect illumination" rollout, increase the "initial FG point density" value to about 0.7.
This parameter is very useful to add depth to the scene and help correct most lighting artifacts.
The value of 0.7 seemed sufficient for the results desired however; one may tweak these values as desired.
Note that, higher values will result in higher FG processing time. Default 0.1.
Increse the "rays per FG point" to 150. The value of 150 is often the minimum required to achieve a nice and smooth interior lighting however, one may tweak these values as desired.
This parameter helps to improve FG accuracy by shooting rays in the scene. Higher values equate to better results however the FG processing time will increase. Default 30.0.
The "interpolate over num. FG points" is very useful to correct most FG artifacts however; very high values will result in less depth in the scene.
Increase the value to 80.Note that, although very useful and effective, this parameter has little or no impact in the rendering time.
The value of 0 enables the mental ray "brute force" rendering ; which essentially renders the scene without the FG pre process (i.e. raw); this will subsequently increase the rendering times dramatically.
On the "processing" rollout, enable the "geometry caching" function. When enabled, this function caches the scenes geometry every time a render occurs.
For faster render translations; simply lock it to bypass this process. One should only lock it when all geometry changes had been addressed.
To delete any previously cached files, simply click the "clear geometry cached" button, and unlock it.
Default 50.0 (Fig.21a and Fig.21b)
With the above parameters set, it's now time to set mental ray to cache the FG maps.
Back on the "indirect illumination" rollout, pan down to the "reuse (FG and GI disk caching)" rollout.
Change the final gather map type to "incrementally add FG points to map files. This function will calculate and save all the final gather points.
Click on the file toggle to set the name and destination of the saved FG file. Save it in the network preferably...as mentioned earlier. The adjacent button(X) enables the user to delete any existing file in the written destination.
Since we know the overall result of the render, it's wise to enable the "calculate FG/GI and skip final rendering function, if desired. This function forces mental ray to compute the Fg process only, skipping the rendering. Some users prefer to see the final result.
Finally, click the "generate final gather map file now", to render. Or alternatively press shift + Q. (Fig.22a and Fig.22b)
Once the rendering process is finished; change the final gather map type from "incrementally add FG points to map files" to "read FG points only on existing map files". This will freeze and reuse the FG map.
Also, lock/freeze the cashed geometry from "geometry caching" function. (Fig.23)
Mental ray is quite powerful in producing glare; camera depth of field and chromatic aberration effects straight from the renderer however, in this exercise we will use 3Ds Max's rendered elements to facilitate adding some these effects in Photoshop.
The first element to setup is the Z depth. This element will help to add the camera depth of field in Photoshop, if required.
It is prudent to setup its parameters prior to sending the final render:
In the "render elements" rollout, click the "add" button to open the render elements dialog. Choose the "Z depth" element from the list (Fig.24).
The "enable" function needs to be checked.
By default, its file destination path is the same as the render output file.
The min and max Z values are set from 100 to 300 by default. Tweak and test render with its settings to see what suits best.
It is worth mentioning that one can increase the original Z Depth contrast in Photoshop (i.e. with curves/levels) to expand darker/brighter areas. (Fig.25)
Material and object's Ids elements are equally crucial when sending out the final renders; especially when one is required to address changes quickly. (Fig.26)
One should start tagging the objects and materials from the start of the project; as objects and materials can quickly grow to unmanageable numbers.
Once satisfied with most parameters, one can begin to prepare the scene for final rendering.
On "common" rollout set the final output size to 3500x1638 pixels. Note that there was no need to render higher resolution, as the render is looking very sharp and without noise.
On "render output" group, click on the "files" toggle to choose the file location and format.
This new location will subsequently alter the original rendered elements location.
I personally use "Targa Image file" formats, since all the extra rendered elements are being saved however, a growing number of users are choosing ILM's "OpenEXR image file" format.
Note that, when opening these files in Photoshop, one will be required to turn its default 32bits/channel mode to 16bits or lower in order to utilize some of the Photoshop's filters and layer adjustments. (Fig.27a and Fig.27b)
On the "renderer" rollout, increase the soft shadows precision (multiplier) to 4.0.This function will correct any soft shadows artifacts caused by the sun position; at cost of some additional rendering time. Note that this parameter works globally. Otherwise the sunlight's shadow samples would have been more adequate.
Increase the "glossy reflections precision (multiplier)" value to 4.5. This function will correct any glossy artifacts, at the cost of some additional rendering time.
Also, change the "sampling quality" to 1/16 samples per pixel and the filter type to "Mitchell", to increase the rendering quality.
It is recommended not go higher (i.e. 1/64), especially when the final output size is already big.
With everything set, one can finally click render to see the final high resolution render, from your machine. (Fig.28a and Fig.28b)
Alternatively, "distributed bucket rendering (i.e. DBR)" or "net render" rendering techniques could be used for those fortunate enough to have additional computers.
Distributed Bucket Rendering
Ensure to use one method or the other, not both at the same time.
Also, one should not use this rendering method for animations. It works best with still images.
All files should be (i.e. FG; bitmaps; file output path etc) in a shared drive (not local drives i.e. C drive, etc).
Open the "render set up", on "processing" rollout, under "distributed bucket rendering" parameters, check the "distributed render" function.
Click the "add" toggle to add the IP address. The "add/edit DBR" host" dialog box should appear.
Type the IP address number followed by ok to close the dialog box.
Keep adding as many as available and allowed.
To edit, simply select one machine at time and click edit.
To monitor the rendering process, simply open the "mental ray message window.
Check all its options (i.e. information, progress, debug (output to file), open on error etc). (Fig.29a)
Ensure that all your files (FG; bitmaps; file output path etc) are in a shared drive (not local drives i.e. C etc).
Also, the "net render" toggle needs to be checked, and click render. The "network Job assignment" dialog box should be prompted.
Ensure that the "include maps" function is enabled; in case there are any bitmaps or mapping coordinates missing.
Click "connect", to see all the available machines in the server. Select the desired machines from the server field name.
On the "server usage" group, choose "use selected" to enable only the selected machines to be used.
On the "options" group, choose the "split scan lines" option, followed by clicking on the "define" toggle. The "strips setup" dialog box should be prompted: set it to pixels; the overlap value to 2; the number of strips to 10 and strip height to 48; and click o.k. to close the dialog box. Click submit to render. (Fig.29b)
Disable the "use map" function and its color swatch to white. This is to make the background color white.
Keep the image "sampling quality" as before 1/16 samples per pixel and "Mitchell" filter.
Finally, turn off the exposure controls and click render.
Ambient Occlusion (AO)
It is common practise to save out the AO as a separate pass, for compositing. This methodology enables users to have full control of its appearance without having to re-render.
Open the "material editor" and choose a completely new material slot by dragging and dropping from one editor slot to another.
Rename it, and load a new mental shader from the "material/map browser" list. See (Fig.30a and Fig.30b)
With the mental ray shader loaded, click on its "surface" toggle to load up the "ambient/reflective occlusion" shader, from the "material/map browser" list.
Its parameters should load up; change "samples" value to 60; the "spread" value to 7.0 and "max distance" to 0.3.
Note that these values worked best for the effect intended however; one may try different values, if desired. (Fig.31a and Fig.31b)
Next, open the "render setup" dialog and select the "processing" rollout.
Enable the "material override" again, and drag and drop the AO material slot to the "material override" toggle. Choose "instance" method. (Fig.32).
Disable the FG and open the "environment and effects" dialog.
Disable the "use map" function and its colour swatch to white. This is to make the background color white.
Keep the image "sampling quality" as before 1/16 samples per pixel ; "Mitchell" filter and the "soft shadows precision (multiplier)" to 1.0 .
Finally, turn off the exposure controls and click render. (Fig.33a and Fig.33b)
Photoshop is very powerful and useful when incorporating quick changes and/or effects that would otherwise be time consuming to address in Max alone. Having said that, it is also important to have relatively decent renders from Max. This work process will later prove very fruitful for one's final piece.
In this final part of the tutorial, we will bring in the main rendered image, along with the pre rendered AO element.
Although we had rendered numerous elements, we will be using the AO pass only, for the purpose of this exercise. Open the main render along with the above mentioned element.
Select the rendered image document; on its "layer" rollout duplicate it, by right clicking and selecting the "duplicate layer" option from the popup list.
Name it "render"
Also, change its original white color to red, by right clicking on the layer and selecting the "layer properties" option from the list. This will help differentiate layers. (Fig.34)
The next step is to emulate the "bloom" camera effect. Note that this effect could have been easily achieved with mental ray however, we had decided to do it in Photoshop, as it gives us the flexibility to quickly edit/choose the areas affected by this effect.
Open the "channels" dialog and press Ctrl + left click on the "alpha" layer, to select its pixels.
Note that, the alpha channel came integrated with the TGA rendered file.
Now that the alpha channels are selected, Inverse the selection (Shift + Ctrl + I), to select the desired areas.
Use the "polygonal lasso tool" (L) to subtract (Alt) and/or add (Shift) selection areas for the bloom effect. These areas should be white, preferably.
While the selection is still on, save it by clicking the "select" rollout from the main toolbar and choosing the "save selection" option, from the dropdown list.
Name it "bloom", on the "save selection" dialog, name field.
This new selection should now be automatically added onto the channels list. (Fig.35)
Next, while the selection is still on, select the "render" layer, followed by copying (Ctrl + C) and pasting (Ctrl + V) to create a new layer from the selection.
Change its layer properties colour to blue, and name the new layer "bloom".
Next we are going to apply a nice "Gaussian blur" filter to emulate the bloom effect.
Duplicate the layer to keep the original copy.
It is prudent and common practice to retain the original layers prior to editing it.
Click on the "filters" rollout from the main toolbar and choose the "Gaussian blur" filter from the dropdown list.
The value of 11.1 seemed to have worked best however; you may want to try different values, if desired.
For future reference, it is always commendable to rename the layer according to the filter applied, plus its values (i.e." Gaussian blur 11.5"). This will make it easier to remember the original filter applied. (Fig.36)
The reflection of the environment on the mirror is not as intense as the front areas of the window. This is probably accurate however; brighter reflections would look better for the sake of the composition.
Select the dodge tool (O) and the "bloom" layer.
Set the range to "midtones", click and brush around the relevant areas, until satisfied with the brightness. (Fig.37)
Next, we are going to use the "curves" adjustment layer to brighten up the scene a bit.
Add the "curves" adjustment layer by clicking on the ""create new fill or adjustment layer" button.
Choose the "curves" from the popup list.
Add and move points so the brighter areas of the image are increased considerable; and the darker areas slightly.
Use the "brush" (B) tool, to mask out over overexposed areas such as the directly lit and overblown areas by the bed side.
The mask layer works best with black and white colors(X). Black= to omit pixels(X); White= to bring pixels to prominence(X). (Fig.38)
Next, we are going to colour grade the image with the "Color balance" and "hue and saturation" adjustment layers.
To capture the true essence of this particular time of the day, we will first add a mix of red and green tones to the image.
Add the "color balance" adjustment layer.
Increase the red midtone to about +29; and the green to about +12. You may change these values, if desired. (Fig.39)
The "hue and saturation" adjustment layer will help balance the overall tone of the image.
Add the "hue and saturation" adjustment layer. Decrease the overall colour (i.e. master) saturation to about -33.
The next stage is to tweak with specific colors. The first color to concentrate on is red.
Choose the red colour from the palette list.
Increase its "saturation" to about +35. This parameter will only affect the red colors/tones of the image.
Increase the yellows "saturation" to about +49, to accentuate the yellow tones/colors.
Finally, increase the blues to about +56 and its brightness to +100.
Note that these values can be changed, if desired. (Fig.40a, Fig.40b, Fig.40c and Fig.40d)
The "sunset" "feel" of the overall image is now more prominent because it had been color graded.
Now is the time to add the AO pass for additional depth.
Select the AO document and duplicate it.
In the "duplicate layer" dialog; under the "destination" group, choose the relevant document (i.e. "Final render.sunset.tga") destination, and name the layer as AO.
This will paste this duplicated layer in the chosen document, with the appropriate name.
In the "Final render.sunset.tga" document, move down the AO layer to be placed on top of the "render" layer.
The next step is to blend the AO layer and edit its appearance.
Set the AO layer blending mode to "multiply" type. Create a mask for the AO layer, by clicking on the "add vector mask" button. This will help edit this layer with the brush tool (B).
While the AO layer mask is selected, enable the brush tool (B) and begin brushing around the areas of the image that you desire to omit or have less prominence. The mask layer works best with black and white colors(X). Black= to omit pixels(X); White= to bring pixels to prominence(X).
Moreover, the opacity function on the main toolbar helps to set the visibility of the brush strokes.
Finally, one can duplicate the AO layer to accentuate its appearance. (Fig.41)
Sun glare is often associated with the sunsets.
When used appropriately, it can add a lot to an image.
Open the PSD file under the name of "Sun Glare.psd" and drop it at a lower/mid level of the window, on right hand side of the image.
The window on the right hand side was chosen, because it matches with the original position of the sunlight's position in the Max scene.
Ensure that, it's on top of all layers of the document.
Use the "linear dodge (add)" blending mode to help blend it; and edit "transform" it to occupy a small portion of the window.
The final result should be a nice sun glare bursting through the window.
Once satisfied with the image, save it as TIFF, if desired.
Tiff file formats are highly recommended by the reprographics, as these file types retain the original quality of the render. JPEGs should only be used for email and web purposes. (Fig.42)