Post-apocalyptic City - Part 1
In this tutorial I'll take you through the process of quickly creating a textured city in 3ds Max 2009 and how you, through a few extra render passes, can go from a quite crappy render to something half-way decent using After Effects CS3. If all goes well, we'll end up with a finished shot not too far from the clip above. In Part 1 I'll cover the creation of the city in 3ds Max and in Part 2 we'll jump over to After Effects for the compositing.
Click here to go to Part 2
Step 1: Creating Buildings
Create a few buildings in 3ds Max or use the Max file provided above (Fig.01).
The more buildings you create, the more diversity you'll get in your cityscape. (Shocking, isn't it?) Make sure the pivot points of all buildings are placed at ground level (Fig.02).
Lastly, you'll end up with a total building count of around 3000, so low poly is probably a good idea if you don't have a very fast system.
Step 2: Particle Flow
Create a plane and name it "CityEmitter". The buildings you created in the previous step will be distributed across this plane (Fig.03).
Next, go to the Create tab, choose Particle Systems from the drop-down menu and choose PF Source (Fig.04).
Place the PF Source anywhere in your scene. The position is not important (Fig.05).
Under Emission, set Viewport Quantity Multiplier to 100% so you'll be able to see all buildings in the viewport (Fig.06).
Then, under Setup, press the Particle View button. When you open Particle View you'll get what's called a Standard Flow which is basically a list of controllers that control birth, position, speed, rotation and shape of the particles. You also have control over how the particles will be displayed in the viewport and during render. Near the bottom is a list over all available controllers (Fig.07).
We'll now start by adding one of our buildings to the scene.
Step 2.1: Birth
As we don't want buildings to pop out of the ground during animation, all particles should appear simultaneously. We'll therefore set Emit Start and Emit Stop to the same frame. I'll set both to -1 to make sure the buildings are in place before animation starts at frame 0. In my case I want 250 buildings and consequently set the Amount to 250 (Fig.08).
Step 2.2: Position
As you can see, this gives us 250 particles emitting from the PF Source icon (Fig.09).
To attach the particles to the plane instead, we'll need to replace Position Icon in the controllers list with something else called Position Object. To do this, find the Position Object controller in the list of available controllers and drag it on top of the Position Icon controller in the view above. Let go when a red line appears over the Position Icon, meaning it'll be replaced by what you're dragging in (Fig.10).
Having selected the newly created Position Object, you can now press the button called By List, under Emitter Objects, which brings up a window where you can select an Emitter Object. Choose the plane you created earlier called CityEmitter (Fig.11).
This randomly distributes the particles across the plane (Fig.12).
However, if you scrub through the time line, you'll notice that the particles fall away from the plane which, to state it mildly, is less than ideal. To fix this, simply check the box called Lock On Emitter and the particles will stay in position (Fig.13).
This is all good of course, but at this point the particles are placed completely randomly and in a city with streets, this isn't very realistic. To fix this, you first need to create a black and white material for the CityEmitter. Light areas will receive the highest density of particles while completely dark areas will receive none. In the example, I've combined the procedural textures Tiles and Gradient Ramp to create a texture, but you could also paint one in Photoshop or similar to get a more organic distribution map (Fig.14).
Back in Particle View and still under Position Object, scroll down to Location and check the box called Density By Material. The particles are now concentrated in the lighter areas (Fig.15).
To make sure the buildings don't stand on top of each other also check Separation and play with the Distance until the particles have some space between them (Fig.16).
Step 2.3: Speed
Buildings really shouldn't move around that much, so the speed controller is useless here. Right click it and choose Delete (Fig.17).
Step 2.4: Shape
Now we're going to replace the rather boring-looking ticks with the actual building. Clicking on the Shape controller doesn't give us a whole lot of options so we clearly need another one: Shape Instance. Replace Shape with Shape Instance the same way you replaced Position Icon above (Fig.18).
Then, with Shape Instance selected, press the button called None under Particle Geometry Object and choose a building by pressing H on the keyboard. I'll pick my SkyScraper object (Fig.19).
And voila! Nothing happened! This is because the Display settings below are still set to Ticks. Quickly select Display in the list and choose Geometry from the Type drop down menu. We now have buildings, though their rotation might be a tiny bit off. We'll look into that soon (Fig.20).
Go back to Shape Instance and adjust Scale and Variation according to your preferences. I'll keep Scale at 100% and set Variation to 25% to vary the landscape a little bit.
Step 2.5: Rotation
Select the Rotation option from the list. As you can see, it's set to Random 3D which explains why practically no building is standing upright. From the drop down menu, choose Random Horizontal to only make the buildings rotate around their Z axis (Fig.21 & Fig.22).
If you don't wish the buildings to be rotated at all, right-click the Rotation controller in the list and choose Delete.' '
Step 2.6: Adding More Buildings
All that remains now is to add the rest of the buildings. Fortunately, this is a very simple process. In Particle View, select the box called Event01, right-click it and choose Copy. Then right-click somewhere else in the same window and choose Paste (Fig.23).
Then hook the new Event to the PF Source (Fig.24 & Fig.25).
Now, you only need to change a few parameters to have your new building in place. First go to Birth and set the number of buildings you want. This time I want 750 (Fig.26).
Then go to Position Object to change the position of the new building so they won't be positioned in the same spots as the previous ones. Scroll down to the bottom of the list and under Uniqueness press the New button to generate a random Seed number (Fig.27).
Finally, under Shape Instance, choose a new building by pressing the button under Particle Geometry Object, pressing H on the keyboard and selecting a new object from the list. I'll choose Rubble. Then play around with Scale and Variation once more until you're satisfied (Fig.28).
Repeat paragraph 2.6 until all buildings are scattered on the emitter. I chose 500 OfficeBuildings and 50 IntactSkyScrapers (Fig.29 & Fig.30).
Step 3: Finishing The Scene
As you probably don't want your ground texture to look like the distribution map, you need to hide the CityEmitter and use a plane with another texture instead. The easiest way is to select the CityEmitter, press Ctrl+V to duplicate it and choose Instance. Name the new plane Ground (Fig.31).
Then press H on the keyboard, choose CityEmitter and press OK. Right-click the plane and choose Hide Selection. You are now free to apply which ever texture you like to the Ground plane. I chose my very simple Rubble texture (Fig.32).
Now you just need to add some basic lighting and a moving camera and you're ready to proceed to rendering. For lighting I suggest a single direct light with a mental ray Shadow Map for shadows (Fig.33).
Step 4: Rendering
As mentioned above, we'll use mental ray for this tutorial, so the first thing to do is to enable the mental ray Renderer. Press F10 on the keyboard to open the Render Setup window and under the Common tab, scroll down to the bottom to the Assign Renderer section and press the button next to Production. Choose mental ray Renderer from the list. Next, scroll up again to set your resolution. In this example I'm using 640x360, but you are, of course, free to choose whatever resolution fits your needs. Next, set your frame range (0-100 in my example) and choose a place for saving your rendered files. I suggest creating a render folder as you'll end up with quite a few files. The file format we'll use is Targa Image File with the settings shown in Fig.34 & Fig.35.
Still in the Render Setup window, proceed to the Indirect Illumination tab and make sure Enable Final Gather, Caustics and Global Illumination are all turned off (Fig.36).
Then proceed to the Render Elements tab. You'll need three additional render passes for this tutorial: A Matte to separate the city from the sky so we can do an effective sky replacement, an Occlusion Pass to fake global illumination and a Z-Depth Pass to be able to add an atmospheric effect and some depth of field.
Step 4.1: Occlusion Pass
Press the Add ... button and choose mr Shader Element from the list (Fig.37).
Name the pass Occlusion and under Parameters press the button next to Shader to add a new shader. Choose Ambient/Reflective Occlusion from the list. There are a lot of settings to play with to tweak the Ambient/Reflective Occlusion shader, but the standard settings, although a little rough, will do just fine for this tutorial (Fig.38).
This basically renders a pass of the scene where this texture is applied to all geometry (Fig.39).
Step 4.2: Depth Pass
Press the Add ... button again and this time choose Z-Depth (Fig.40).
The Z-Depth pass produces an image where the geometry close to the camera is displayed in white while geometry further away gets darker and darker until it reaches a cut-off point and everything behind it is rendered as black
Under Z-Depth Element Parameters you need to set a cut-off point for where the image goes entirely white or entirely black. In the example scene a Z Min value of 0 and a Z Max value of 2000 works out quite nice as the city plane is 2000 units wide and the camera is looking at the city from one end of the plane (Fig.42).
This might need some tweaking though, so I suggest doing a couple of test renders of still frames before rendering the final sequence.
Step 4.3: Matte
Press the Add ... button for the third time and this time choose Matte (Fig.43).
A matte lets you isolate an object in a scene by making the desired object appear as white while everything else is black. In this case we wish to separate the city from the sky and therefore wish the whole city to appear white against a black background. The quickest way to do this is to by going to the Matte Texture Element options and enabling Material ID, setting it to 0. All textures in 3ds Max have their Material ID set to zero by default and hence every textured object in the scene (should be all objects) will appear white on the render (Fig.44).
Finally, check and double-check your settings and have that cup of coffee while waiting for the render to finish (Fig.45).
This is it for Part 1. I'm a beginner at writing tutorials, but hope it wasn't too long and painful. Anyway, this should keep your computer nice and busy for a while, depending on your system. If you want to take a peek at my finished file, you can download it below.
Click to Download Tutorial 3DS Max File 42 kb
Click here to go to Part 2