Escolar Documentos
Profissional Documentos
Cultura Documentos
(additional proofreading and removal of hy-phens, "quote marks" and germanisms by Matthew O'Neill)
CINEMA 4D R9 is recommended, however most of the tutorial also works in 8.5 (with a few workarounds for certain parts).
You will need a bittorrent client to download the files that accompany this tutorial. If you don't already have a bittorrent client, I suggest installing
Azureus for Windows or MacOSX, a free java based client.
Download the bittorent file from this page and open it with your bittorrent client (if it doesn't open it automatically). Your client will then start
downloading a zip archive which includes the video tutorial, final project files, example animations and the painting in .psd format. Due to bandwidth
limitations I'm unable to host the files directly on 3dfluff. Bittorrent works by sharing the already downloaded parts with other people so please leave
your bittorrent client open for a few hours after you've finished downloading. The more people download the file and leave their client open, the faster
other people can download it. For information on bittorrent go here.
UPDATE: The C4D Portal is now hosting the tutorial as well! Without bittorrent but with direct download links instead. So if you don't want to use
bittorrent check out this link.
Introduction
http://www.3dfluff.com/cameramapping/cameramappingtut.htm (1 of 26) [07/09/2004 13:58:15]
camera mapping tutorial
This tutorial is about magically turning an image into 3D. Actually there isn't any magic involved but it is possible to some degree to turn a flat image
into something 3D. The method is called "camera mapping" or "camera projection". In Cinema 4D there is also a texture mapping method called "frontal
mapping" which is essentially the same. The image is projected through the camera onto the geometry. However, with frontal mapping the texture has
to be "stuck" to the geometry if you want to move the camera - either with uvw coordinates or a stick texture tag. It is also limited to just one camera.
Since release 8.5 there is an additional method called "Camera Mapping". There is no need to use UVWs or stick texture tags anymore - one camera, the
"projection camera", is used to project the texture while any other cameras can be used to animate and render the scene.
Camera mapping is mainly used for matte paintings in movies. These days matte paintings aren't just static flat paintings in the background. Matte
paintings can now be 2.5D - they are projected onto 3D geometry which allows for much more complex camera moves and perspective changes.
The video is showing the basic setup with just a floor plane, a sky dome and a few landscape objects that are positioned to roughly match the mountains
in the painting. In this tutorial I will go a bit more in depth and explain a few more things such as how to include an additional cg object and how to add
some atmospheric effects. This tutorial is not meant as a complete step by step tutorial (it would be the size of a book and most readers would probably
fall asleep before reaching the end). You should already know how to create polygon models, create and assign materials, deal with tags and so on. This
tutorial is probably more suitable for advanced users.
There are two ways to make a 2.5D environment - either start with the 3D geometry then paint a matching image to project onto the geometry or first
paint an image and then worry about the 3D geometry afterwards. In my case I did the image first.
The 2D bit
When I speak about painting I don't actually mean painting in the traditional sense, for this tutorial I mostly used photos of mountains, snow and clouds
and then painted over them to add or remove details. I also used a lot of adjustment layers in Photoshop to change the colour from daylight to night
time. Here are a few stages from the original image to the final painting (click to see bigger versions):
Small note: When loading a scene the colours for the texture display in the viewport may be reduced. This is because Cinema generates a copy of the
texture just for the viewport display. This preview texture gets saved in the scene file so it doesn't have to be recalculated everytime you open your
scene (which would otherwise take a lot of time with many textures). However, to keep the scene file size small the texture gets compressed which
results in reduced colours. If you want to revert the texture display back to its original state go to the material manager menu and choose Function >
Render Materials.
The sky should be quite big and flat, not just a round sphere. The flatter you make it, the more of a 3D effect you will get when moving through the
http://www.3dfluff.com/cameramapping/cameramappingtut.htm (4 of 26) [07/09/2004 13:58:16]
camera mapping tutorial
environment. The clouds will appear to be hanging low above the environment. So change the flatness depending on your taste and how low you want
the clouds. Just make sure you don't make it too low, otherwise if the camera gets too close to the sky the texture resolution won't hold up and the
perspective will be too extreme.
Now assign the material to both the sky and ground and set the projection to "Camera Mapping":
You won't be able to see anything in the viewport yet. That's because we haven't assigned a camera to the projection. As I already mentioned, camera
mapping works by projecting the painting through a camera onto the geometry. So create a camera and rename it to "projection cam". Link the camera
to the perspective viewport and drag it from the object manager into the "Camera" input field of both texture tags. Also make sure that the projection is
set to the correct texture size, otherwise the painting will be squashed (press the calculate button):
There should be something to look at in the viewport by now and after doing a first rough camera aligning it should look similar to this in gouraud
shading with lines:
(If it doesn't look exactly like this, have a look at the next paragraph about viewport shading).
Now rotate and position the camera so that the horizon is aligned with the horizon in the painting. Try to match the perspective as best as possible.
Finding the right height of the camera is a bit of guesswork, maybe have a look at the side view and try to imagine what the angle between the camera
and the ground would be. It doesn't have to be absolutely precise, the perspective in the painting probably isn't 100% correct anyway.
Now duplicate the projection camera and rename the new camera to "render cam" and link it to the perspective viewport. Make both cameras invisible
(upper visibility dot) so they don't get in the way.
After this you shouldn't touch the projection camera anymore. If you don't trust yourself not to accidently move it, assign a protection tag to it (File >
CINEMA 4D Tags > Protection in the object manager).
You can now use the render cam to move around in the scene and get a feel for the 3D effect it creates.
Higher subdivisions improve the viewport display of textures. This doesn't influence the rendered result though, the textures are always projected
properly in the final render no matter how high or low the subdivisions are.
With Release 9 Maxon added a number of new shading modes to Cinema 4D. The most important additions are Gouraud Shading (Lines) and
Constant Shading.
"Constant shading" looks the same as "Gouraud Shading (Lines)" when using a material with 100% luminance. Maybe you're wondering why not just
use constant shading to start with? The answer is that constant shading always displays the wireframe. I don't always want the wireframe visible though
so that's why I choose to use gouraud shading and a luminance material. This way I can switch between gouraud shading both with and without lines.
The line shading modes are a great new addition, especially for camera mapping and matte painting.
Unfortunately in 8.5 there is no easy way to display shading and wireframe at the same time. A good workaround is to group your geometry, make an
instance, make sure the instance is in the same position, assign a Display Tag to the instance and set it to display as wireframe. The result is almost the
same as using gouraud shading with lines in release 9.
This works perfectly because the ground in the painting is completely flat. If there wasn't a flat ground the situation would be more complicated and the
placement would be more difficult to work out (probably involving a lot of trial and error). I continued like this for all other foreground mountains. If you
look at the top view you can see how far the mountains will be stretching into the distance. So by projecting the splines you have already worked out
where they would be placed in relation to each other:
The next step is to draw additional splines along the contours and folds. The result should look something like this:
We're not actually using the splines to build the models, the splines are just guidelines to get a rough idea of the shapes. You can now set up one of the
other viewports as perspective view and start building the mountains point by point, following the spline contours:
Use the create polygon tool or the bridge tool to connect the points:
Ctrl-drag one of the texture tags onto the new geometry and check out your first 3D mountain:
More 3D mountains:
And here is the finished geometry - I had to subdivide the one on the right to add more detail. I also added more geometry for the smaller mountains in
the background:
Moving clouds
Cloud movement adds a bit of life to the otherwise static environment. I used a bone with a vertex map to deform the sky (yellow means strong
influence, red means less):
The vertex map adds a soft falloff. Rotate the bone and the clouds will appear to be moving, with the top clouds moving faster than the ones at the
horizon. For many cases this is good enough. For more "advanced" cloud movement you can use layers or planes of clouds with alpha maps and position
those in front of each other and animate them individually. However, this method needs more planning. When painting the sky in Photoshop, keep all
the clouds on seperate layers. This isn't always easy to do, especially if your sky is mainly based on one photo. It is difficult to seperate the clouds
afterwards. If you plan to use layers for the clouds you need to keep this in mind right from the start when painting the sky.
Before animating the bone, you need to stick the texture to the sky object, otherwise the geometry will move but the texture won't move along with it.
Select the texture tag on the sky object and choose Texture > Generate UVW Coordinates. That should take care of that. Also don't forget to fix the
bone (right click the bone in the object manager and choose Fix Bones) before animating it.
Adding an aerial
Now let's combine this environment with an additional cg element. Why not put an aerial (or something else suitable) in the foreground:
Until now we've been using the painting in the luminance channel of the material. This is just a shortcut to make it easier to display in the viewport. We
can't leave it in the luminance channel though. If you want to include other objects in the scene to cast a shadow on the geometry, you need to use the
color channel...
...and apply a compositing tag to all the mountains, sky and ground (File > CINEMA 4D Tags > Compositing in the object manager) and switch on
"Compositing Background":
The objects will still be rendered at 100% brightness but other objects (like the aerial) can cast shadows onto the environment geometry.
Unfortunately now the shading is looking different in the viewport. Now that the texture is in the colour channel, the geometry is shaded and in this case
mostly dark. You could use the Constant shading mode from the Display menu but the downside is that you would always have the wireframe visible as
well. There is a workaround though - make an environment object and set the Environment Strength value to 100%:
Now it should look like constant shading in the viewport. But don't forget to switch off the environment object for rendering (change the lower visibility
dot in the object manager to red). Now the shading is back to what it used to look like earlier:
I set it to cast an area shadow. I also set it to only include the ground and the aerial so none of the other objects can cast or receive any shadows (you
could also set them not to receive shadows but this is quicker):
For the ground fog (well it's not actually fog, it looks more like moving shadows) I used a parallel square spot light without illumination but with visible
light. The visible light uses a noise which is animated.
If the effect isn't visible enough you can turn up the "Dust" parameter on the "Visibility" tab. The dust parameter makes visible light visible even when it
is darker than the background (mainly useful for dark smoke effects and such). The light is pointing in the z direction and is scaled down on the y axis
(using the Object tool - the one that actually scales the axis, not the Model tool) so that it's flat on the ground:
For some more atmosphere, add a particle emitter that is big enough to cover the entire environment:
To achieve a dense snowy atmosphere you need to turn up the number of particles a lot. I've set mine to 10000 particles in the renderer (and 1000 in
the editor to speed up the redraw). Actually 10000 particles is the limit for a single emitter. Now that shouldn't stop you of course! Just duplicate the
emitter to get more particles. Apart from a gravity object I'm also using a wind object with animated wind speed to blow the particles around. This is the
wind speed fcurve, the values vary between 0 and 50:
To speed up the rendertime and display you should place a particle destructor object underneath the ground to kill any particles that have gone through
Now we just need to get the particles to actually show up in the rendering. What I tried to achieve is the streak effect you get from motion blur. There
are several possibilities. You could use little spheres with a luminance material or visible lights and motion blur to get the streak effect. However, if
you're the lucky owner of the Sketch and Toon module, you have a very powerful particle drawing engine at your fingertips. Sketch and Toon doesn't
just make cartoony looking objects, it can also be used to draw particles as lines with varying length, thickness, colour, opacity and more (you could
even render them as lots of little arrows, the possibilites are endless).
To use Sketch and Toon, open the Effects page in the render settings and choose Sketch and Toon from the post effect popup. On the Main page, set
the control level to "Advanced" to get access to all options. On the Shading page, switch off the shading for Background and Objects. Now go to the
Lines page and uncheck all the line types and only switch on the Particles line type. At the bottom of the page there should now be a few options for the
particle line type. Set the Velocity Scale value to 1%. This value controls the length of the particle streaks and the faster the particles move the smaller
you should make the value:
When creating a Sketch and Toon post effect a "Sketch" material is created automatically. This material defines all the line parameters like thickness,
colour etc. It doesn't need to be assigned to any object, it is used by the post effect directly. Open the material. The interesting pages are Color,
Thickness and Opacity. I've set the colour to a light blue and the thickness to 0.5 (this is measured in pixels). The Opacity is set to 70% and uses an
inverted spline curve to reduce the opacity of the particle streaks along the stroke length:
Now all that's left to do before rendering the scene is animating the camera. I'll leave you to that. I've done two example animations (in the bittorrent
file above, snowy_part1.mov and snowy_part2.mov) for inspiration. If you move the camera too high up or too much to the side you will probably
see some texture stretching. If you want to know how to deal with this problem, read the part a bit further down about fixing projection problems.
Lastly there is a lot you can do in compositing. You could change the levels, add more contrast, tweak the colours and maybe add a bit of film grain. I
also used multipass rendering so I could slightly blur the background to soften up the sharp lines between the mountains and the sky while keeping the
aerial crisp. Here is a still from one of the animations after compositing:
Or if the situation is very bad, render out a still from the perspective that is showing the problems and correct all the problem areas in Photoshop. Then
make a new material with the new painting, set up a second projection camera from this perspective and assign the new material to those models or
polygons that show the problem. To avoid seams you could also paint an alpha map to blend between the two paintings and only make the second
painting show up in certain areas.
So to summarise: The more you want to move the render camera, the more you will have to set up additional projection cameras with additional
paintings to cover up problem areas.
Random tips
Use Layers! If you're doing a matte painting in Photoshop, don't merge everything down. Keep it on seperate layers if you can. If the list of layers gets
too long, group your layers into folders. Now if for some reason you need to move an object to a different position you can just move the layers. If you
had merged all the layers down you would have to repaint everything.
This tutorial may not be reproduced or redistributed without prior permission of the author.