MR Rendering a night/evening scene

From TOI-Pedia


Introduction

This tutorial explains how to render a night scene in an urban setting. In this tutorial we will show you how to change the Physical Sun and Sky in such a way to create evening lighting with the sun just set and in the middle in the night.

Furthermore we will show you how to create light emitting shaders and textures for use with lampposts and windows.

Loading the player...



Creating a night render with Physical Sun and Sky

You can change the sunDirection with the rotate tool. Rotate your sunDirection pointing the rays (arrows) sidewards or upwards. The scene gets darker as the rays point more upwards.

A render in the evening

A render in the night

Compare both images. Notice the skyline and the direction of the sun in the insert in the corner.

You may also use the TOI Sun Simulator to set the direction of the sun on a certain day and time

Creating a simple light emitting object

In an urban area the nights are not pitch black. There is always lighting somewhere. This light can be from lampposts, windows, bus stops etc.

Instead creating a real light, we wil make a mia_material that emits light. This way we reduce render time and the rendered scene has the same realistic look as a scene rendered with real lights.

A lamppost

  • This lamppost consists of three parts. The post itself, the luminous part and on top the pan. It is created as one polysurface and shaped with several extrusions.

Lamppost.gif

  • Create a mia_material_x for the post and pan. And create another mia_material_x for the luminous part, the light itself.
  • Go to the Advanced section and click the black box to the right of Additional Color

Mia additional color.gif

  • Make sure the color-picker is set to HSV-mode[1]:

Color picker set to HSV.png

  • Pick white as color for a white light and change the value V in 50. E.g. a Value 1 means that the material emits same energy as it absorbs. A higher number means that it emits more energy than it absorbs which is physically impossible, but very handy to create luminous objects.

Mia add color chooser.gif

  • Accept and close the windows and assign this material to the luminous part of the lamppost.
  • Open the Render Settings using mental ray.
  • Create the Physical Sun and Sky if not created yet and change the sunDirection to get a dark scene.
  • Increase in the Final Gathering section the Accuracy and Point Interpolation until the spots disappear. The Point Interpolation is about two third of the Accuracy.

Mr settings fg night.gif

In the first picture below you will see the light is spotted. This happens with low Accuracy and Point Interpolation settings. Increase Accuracy with steps of 50 until the light looks normal. Always keep the Point Interpolation about two third of the Accuracy. Note that higher Accuracy increases render time. Render time of the second and third picture are the same.

Mr night variants.jpg

Creating light emitting textures

When assigning textures to buildings the most common way will be with the use of UV mapping:

  • Planar Mapping; assigning tiling textures per plane.
  • Automatic Mapping; assigning textures with the UV Texture Editor.

Textures with UV Mapping

In this example we will use Planar Mapping to assign the light emitting textures to the corresponding façade. The principles of assigning light emitting textures with Automatic Mapping with the UV Texture Editor are the same.

  • Create a mia_material_x and assign an image file to the Diffuse (color) attribute by clicking on the checker box. This image file will be tiled over your façade. This will determine the the color of the facade.
  • Assign a black and white image file to Additional Color (under the Advanced section) which indicates the light emitting parts of the façade. Use the previous image file to create a black and white image file in Adobe Photoshop. This texture determines the amount of light being emitted from the facade.


File additionalcolor.jpg


In Photoshop select the light emitting parts of the façade and fill the area grey or white, depending on the amount of light you want to be emitted, using the Paint Bucket Tool. Invert the selection and fill the rest with black, because we don't want the rest of the façade emitting light.

Make sure in both cases that black is really black (RGB: 0, 0, 0), otherwise parts that should not emit light will emit some light.

This black and white image file can also be used for bump, transparency or reflectivity
  • Now we will increase the Value V of the Additional Color. This time clicking on the black box to the right of Additional Color will not work. In this case click on the arrow box next to the slider. This will open to the Attribute Editor as below.

Attr colorbalance.gif

  • At the Color Balance section click on the white box to the right of Color Gain. The Color Chooser appears and set the Value V higher than 1 to make this texture emit light.
  • Select in component mode a face which will be the façade. Go to Create UV's > Planar Mapping to create the correct projection and also assign your mia_material_x to this face.
  • Render your scene to see the results and if the tiling of your texture on your façade is correct.

Rendercheck luminous planarmap.jpg

  1. HSV: Hue, Saturation and Value

--

Personal tools
Actions
Navigation
Tools