In this tutorial we will be using a finished model. You can download it

As a starting point I used this.

Created one directional light (sun), that casts depth map shadows with 2k resolution.

Also I created four directional lights from different sides to create blue illusion of sky illumination.

When rendered, the image looks like this. You can notice that those four lights make the scene look flat. Later I'll use an ambient occlusion pass to make small details more visible.

I used blinn materials for some buildings.

I assigned a texture to it. You can notice how odd it looks. We need to fix the UVs.

Select all faces.

Use cylindrical projection to project texture from cylinder around the object. Use manipulators to fit the cylinder to your object.

I also added bump using the same texture, and used that same texture for specular color.

Select all faces that look to the sky. Use planar projection to project texture to them.


I also created few more materials.

For some parts I used automatic mapping. This will try to project the texture from different angles.

You might notice that the texture looks very big. In the UV texture editor, you can select all UVs and scale them. This will repeat the texture.


Now the cityscape is starting to take shape.

For small lights, I created very simple geometry and assigned surface shaders to them. I added a bit of glow to them. You can add glow also in compositing passes.




Now Rendering Layers. Select all objects except those tiny glowing objects (grouping and selection sets will be your great ally in this step), and in the channel box check render. This will display your render layers. By default, all objects are assigned to masterLayer. Click that second button (one with tiny blue ball), this will assign objects to the new layer you created. Double click to layer and change its name to Color. All new layers will be named layer1 by default. Check 'R' in the box to the left. That means that layer is rendered. The masterLayer shouldn't have this 'R'.

With same selection (all except the tiny glows), create new layer. Hold right mouse button on layer1 (that new layer) and you will see presets submenu. Choose Ambient occlusion. This will create a shader override for all objects in that layer. Name the layer occlusion.

In hypershade, you can see that new surface shader was created. In color input it has mlb_amb_occlusion1. That is the mental ray occlusion sampler. Set samples to 32. The more samples you set, the less noise it will have and the longer time it will take to render.

If you render that layer, you can see the result. In compositing, I will multiply this layer with color to make details more visible.

Our scene still looks normal.

Select all objects in the scene, except lights and create new layer. Select all objects except the tiny glows and assign one surface shader to it. That material will be assigned to those objects only in that layer.

Set all attributes to black. When matte opacity is black (0) it will not create alpha and it'll block out all other objects and have no color.

If you render that glow layer, the colors shall be blocked in all other objects and only those tiny lights will have alpha, so it could be put over all other layers in compositing.


In options, check Render All Layers if you want to render all layers together. You can also set blending modes for each layer to get preview.

Create another layer, and assign all objects to it. Assign a surface shader to all objects.

In Out Color for surface shader, create a Ramp texture, as projection. This will create a placement node for texture.

Scale the placement node to fit all geometry in the scene.

Change colors in ramp from white to black.

When rendered, that layer looks like this. We will use it for the fog (Y depth).

The last thing you need to do is to render all layers or do a batch render of the sequence if you have it.
For compositing I will use Shake. In Shake, I created four fileIn nodes with render layers.

If you like hypershade, you will love Shake. So use Imult node to multiply color with the ambient occlusion layer. This will darken the holes and details.

Then with over node put glows on top of IMult layer.

This is a little more complicated, I used IMult to change the density of fog, with Reorder, I copied the R channel of image to Alpha channel, since Color node (plain color) is using it for a mask.
The Color node is orange, but here the thumbnail is black. Then that orange goes on top of over1 node.

Here I added blurred glows as the height drops. Those glows on the streets are blurred.

discuss this topic to forum
