Texturing and lighting the Nissan R390 GT in 3ds max 5

Introduction

Creating a believable 3d model is strictly tied with an accurate definition of its materials and textures: realizing and correctly applying the textures on a model is a complex and long process in the creation of photorealistic renderings.
About the rendering process, i will simply descrive how to obtain a believable rendering in an exterior environment, and we will be greatly helped in this achievement by the new characteristics of the many global-illumination capable rendering engines.
Nowadays there are many rendering options to the average 3ds max user, from the built in "Light tracer" to 3rd party rendering engines (i.e. Splutterfish's Brazil, Chaotic Dimensions's Vray, Cebas's Final Render). To add even more, the latest 6th release of 3ds max made many artist's dream come true: the integration of Mental Ray 3.2.
The principles behind global illumination are common to all of this options, but interfaces and programmin algorythms differ quite a lot, bringing up confusion and differences in quaity and performance.
For the sake of simplicity i will discuss only the Light Tracer.
To complete this tutorial you will need 3ds max 5 (at least) and a graphic software like Macromedia Freehand or Fireworks (which was my choice), or Adobe Photshop or a similar software. I will not discuss the operations needed to paint in these softwares, but for our purposes we will just need a very basic understanding on how to create texts and shapes, so everybody reading this should be able to go through the process.

Section 1: Planning

Just as you plan ahead the number of faces your model will need for its purposes, in the same way you also have to plan the size of the textures you will realize. Finding yourself with wrong textures in the end is a very bad experience. In our project, we are aiming for *at least* 1024x768 detailed renderings: this means that all of our textures will have a minimum resolution. Lower reolutions will almost surely lead to artifacts in our final renders. To simplify, imagine you have a bonnet texture at 200x200 pixels: if you render an image where the bonnet fits the render, you won't be able to render images larger than 200x200 without getting artifacts, as 3ds max has to guess the missing informations. Nowadays hard disk space is (finally and luckily) a minor problem, so i always tend to "oversize" the textures so i am 100% sure they will meet my needs. In this case i went for 2000x2000 pixel textures for larger areas (as the bonnet) and 1000x1000 for smaller panels. The actions required to create the textures and to define UVW coordinates on the whole model are repetitive and fairly simple, hence i will explain how to apply textures and materials to a single element, the bonnet: it's up to you to continue with the rest ;)
 

Section 2: Materials

Fig. 1: <strong>the final render</strong> this is what you will get at the end of the 2nd part

Fig. 1: the final render this is what you will get at the end of the 2nd part

The most important thing about the material i used on the Nissan, is that after various tries (where i just put a coloured bitmap in the diffuse channel of a generic paint-like material), i went for a more complex and relistic approach: using a complex "blend" material i was able, with simple masks, to "paint" the car with different paint materials (white, red, black...), each one with its own characteritics and parameters. The result is a more realistic output, like the one you can see in Fig. 01.

Section 3: Mapping and definition of UVW coordinates

Mapping a model is a process to let 3ds max know which parts of a bitmap are to be where on the model itself. In the simpler situations, standard mapping options in 3ds max can be enough (for objects similar to spheres, cylinders, cubes..), but, as the model gets just a bit more complex, these methods are no longer enough.

Fig. 2: <strong>UnwrapUVW</strong> what we should get at the end of the mapping process

Fig. 2: UnwrapUVW what we should get at the end of the mapping process

Fig. 3: <strong>Mesh Select</strong> select the highlighted faces

Fig. 3: Mesh Select select the highlighted faces

A correct mapping has to achive 2 main objectives: you must be able to paint simply and intuitively your textures (Fig. 02) and it must not lead to any distortions or arefacts in your renderings. Luckily enough, cars are generally built with big almost planar surfaces, and this greatly simplifies our task as we can almost always use planar mappings and get good results with small tweaks. Let's see how we can map the Nissan's bonnet: at this stage we have objects with a modifier stack like this: Editable poly > Simmetry > Meshsmooth.

Fig. 4: <strong>UVWMap</strong> align the planar gizmo

Fig. 4: UVWMap align the planar gizmo

Fig. 5: <strong>UnwrapUVW</strong> check the mapping

Fig. 5: UnwrapUVW check the mapping

Let's apply a "Mesh select" modifier between the "Simmetry" and "Meshsmooth" modifiers, go in "Polygon selection" mode (by clicking on the little red square in the modifier panel) and select the faces as shown in Fig. 03: as you can see, this selection can be mapped with the same planar mapping (excluding the area inside the headlights, but there will be just black paint so we can go on without caring about this area). By doing this selection, we assured that the next modifier in the stack will work only on the selected polygons: let's add (without deselecting the polygons and leaving the small square icon clicked!!!) an UVWMap modifier, and select the "Planar" projection option.

Align and adjust the planar projection gizmo like in Fig. 04, helping yourself with the "fit" button and the alignment options (in this case i aligned it to Y axis).

Be sure to make the gizmo square by changing the values to suitable ones (ie clicking "fit" i got a 193x136 gizmo, which i rsized to 200x200). At this point, add a Unwrap UVW modifier to the stack (always BEFORE the meshsmooth) and take a look at the mapping so far achieved by clicking on "edit" in the modifier panel (see Fig. 05).

Fig. 6: <strong>Mesh Select</strong> select the hilighted faces

Fig. 6: Mesh Select select the hilighted faces

Fig. 7: <strong>UVWMap</strong> align the planar gizmo

Fig. 7: UVWMap align the planar gizmo

Fig. 8: <strong>UnwrapUVW</strong> check the mapping

Fig. 8: UnwrapUVW check the mapping

Add a new Mesh Select modifier and select polygons again, as in Fig. 6. Add another planar UVWMap modifier as in Fig. 07, making it square as before. Add another UnwrapUVW and check the mapping (Fig. 08). To the same for the left side of the bonnet (Fig. 09 and Fig. 10).

Fig. 9: <strong>Mesh Select</strong> select the highlighted faces

Fig. 9: Mesh Select select the highlighted faces

Fig. 10: <strong>UnwrapUVW</strong> check the mapping

Fig. 10: UnwrapUVW check the mapping

Fig. 11: <strong>UnwrapUVW</strong> check the mapping

Fig. 11: UnwrapUVW check the mapping

At this point add another Mesh Select modifier and DO NOT select anything, so the next modifier will work on the whole object. Add an UnwrapUVW modifier and click on "Edit" to see how the whole surface has been mapped. As you can see in Fig. 11, the 3 elements are overlapping: this is easily fixed by selecting the scale, rotate and move tools in the editng panel and checking the "Select element" option. This way you can easily accomodate the 3 elements in the square area as in Fig. 12.

As you can see, the selected element in Fig. 12 has to be mirrored (just click on
the "Mirror" icon) to get the proper mapping (Fig. 13). Also the main bonnet surface is somehow mirrored (i realized this only after the first test render), so just do the same operation on the main surface.
Sometimes (Fig. 15) having the textures projected on the eding window is very usefull to ad just particolar vertices and to check for distortions with a visual feedback: to achieve this, you have to click on the "Show map" button and choose the texture you want to see. If you cannot see anything on the background, chances are that you simply need to push the "Brightness" value in the "Show options..." panel to a value greater than 0.
 

<h6>Fig. 12: <strong>UnwrapUVW</strong> adjust the mapping</h6>

Fig. 12: UnwrapUVW adjust the mapping

<h6>Fig. 13: <strong>UnwrapUVW</strong> adjust the mapping</h6>

Fig. 13: UnwrapUVW adjust the mapping

<h6>Fig. 15: <strong>UnwrapUVW</strong> checking the textures on the model</h6>

Fig. 15: UnwrapUVW checking the textures on the model

Section 4: Painting and application of textures

Fig. 14: <strong>reference</strong> paste the reference image in your painting software

Fig. 14: reference paste the reference image in your painting software

Fig. 15: <strong>painting masks...mask1.png</strong> easy, it's only black and white

Fig. 15: painting masks...mask1.png easy, it's only black and white

Fig. 16: <strong>mask2.png</strong> another mask...

Fig. 16: mask2.png another mask...

Maximize the UVW editing window and press "Print scr" ("Stamp" on italian keyboards) to get a screenshot of the monitor in memory. Open your software of choice for tecture creation (Fireworks in my case) and create a new image with a resolution of 2000x2000 pixels and a white background. Press "Ctrl + V" to paste the screenshot in the newly created image, cut away the parts outside the blue square area and rescale the image to fit the 2000x2000 background (Fig. 14). Using this pasted screenshot as a reference we can start painting the masks for our blend material. The first mask will define areas where the white paint is showing. Black areas of the mask will show the white paint (Fig. 15, note the background reference image shown in semi-transparency on the bottom layer). Save the mask as "mask1.png" (or any other 3ds mnax compatible and not destructive image type as TIFF, BMP...).

Let's go back in 3ds max and create 3 standard materials, naming them "white paint", "black paint" and "red paint", changing only the diffuse color to the respective color. We will later change this materials to proper reflective paint materials, but now we just need fast rendering test materials. Create a new "Blend" material and name it "bonnet".

Fig. 17: <strong>mask3.png</strong> the rising sun!

Fig. 17: mask3.png the rising sun!

Fig. 18: <strong>mask4.png</strong> the black/red gradient on the bonnet

Fig. 18: mask4.png the black/red gradient on the bonnet

Put "mask1.png" in the "Mask" slot. The material in the first slot ("Material 1") will show up in the black areas of
the mask, while "Material 2" will show up in white areas. This is pretty simple, but the material tree can get quite complex so keep this principle in mind if you start getting confused. Create a new "blend" material in each one of the 2 slots. Name "white" the first material and "black" the second (i couldn't find a better naming, just name things so you can understand at a glance where you are in the material tree).
In the newly created blend material ("Material 1" of the root blend material), which will show in the black areas of mask1.png, we will need white paint areas (sponsors), black paint areas (number 22) and red paint areas as well (the rising sun in the japanese flag), so we need a new mask (Fig. 16) (mask2.png). Put it in the Mask slot. Drag an instance of the white paint in "Material 2" slot: thus the white paint will show in areas defined by black areas in "mask1.png" and white areas of "mask2.png". Create a new Blen material in "Material 1" slot (i named it "red and black"). If you are getting confused help yourself opening the "Material / Map navigator" by clicking on the relative button in the material editor.

In the newly created Blend material, put "mask3.png" (Fig. 17) in the "Mask" slot. Drag an instance of "red piant" in "Material 1" slot and an instance of "black paint" in "Material 2" slot. Go back to the root Blend material and click
on "Material 2" slot ("black"). Put a new mask in the "Mask" slot (Fig. 18, "mask4.png").
Drag an instance of "Red paint" in "Material 1" slot and an instance of "black paint" in "Material 2" slot.
That's it: the principle behind this material, as said, is quite simple, so if you are getting confused feel free to do some experimentation to understand how all this masks and blend materials work together.

Section 5: Creating the shaders

Fig. 19: <strong>a test render</strong> check the masks...

Fig. 19: a test render check the masks...

Fig. 20: <strong>paint is finished</strong> check the paints and tweak if necessary

Fig. 20: paint is finished check the paints and tweak if necessary

Having assigned the "bonnet" material to our bonnet model, fire up a test render which should output something similar to Fig. 19. If the result is the same, we can go on in defining proper paint shaders.
The paint shader are quite simple: i will describe how to build "red paint", the other 2 paint (white and black) are similar,
the main difference being the "diffuse" slot: you can also tweak the various parameters to get particolar effects on the different paints.
So, click on "red paint" in the material editor, and by clicking on the material type button (now "standard") switch to a "Raytrace" material. All your instances in the "bonnet" material will automatically update and reflect the changes you are making. Click on the small "Diffuse" square button and select "Falloff Map" from the list that pops up. Set the Falloff Map type to "Fresnel" and set the "Front" color to 107.0.0 (RGB values) and the "Side" color to 170.114.114. This will make the paint appear a little brighter on the surfaces pointing away from the camera, and quite darker on the surfaces facing the camera.
Put anothe "Fallof Map" (Fresnel type) in the "Reflect" slot, and set the front value to 30.30.30 and the side value to 175.175.175: this way we will have stronger reflections on the surfaces pointing away from the camera, and lighter reflections on surfaces facing it, simulating what's actually happening on real car paints. Go back to the root of the rayrace material and set the color of Specular Highlights to 255.255.255, the level value to 90 and the Glossiness value to 90: this way we will get strong and small highlights. An interesting experiment you can do is to use the "highlight only" blur's plugin in cooperation with a "shellac" material: put the red paint in one slot of the shellac and the
"highlight only" in the other slot: this way you can set up 2 different highlights, simulating the typical car paint "coating".
Create the white and black paint shaders in a similar way and do another test, getting results similar to Fig. 20.

Section 6: Lighting and rendering

Fig. 21: <strong>HDRI lighting example</strong> this is what you can get with an HDRI environment map

Fig. 21: HDRI lighting example this is what you can get with an HDRI environment map

Fig. 22: <strong>Direct light</strong> place it to your tasting

Fig. 22: Direct light place it to your tasting

Fig. 23: <strong>final render</strong> ...is this what you get?

Fig. 23: final render ...is this what you get?

First of all, keep in mind that all reflective materials are influenced (obviously) by what you have around in the scene, being it other models or an environment map. In our situation, we do not have anything to reflect (just a gradient map to simulate a clear sky) so the effect can be less interesting: just using a spherical environment map you can get nice results: try to experiment with different maps, and maybe try some HDRI lighting. This way i rendered the Mini Cooper in Fig. 21.
Anyway, let's start by creating the "sky" map: in a Syandard material put a "Gradient ramp" map in the diffuse slot. Set the first color to a light and soft blue, and the other two to white. Select "Environ" and "Spherical environment" in the "Coordinates" rollout. Go back to the root of this material and drag an instance of the newly created diffuse map on the "Environment map" slot in the Environment panel (in the menu go in Rendering > Environment).We are ready top ut some lighting in the scene: create a "Skyligh" light and put it above the model, using the environment map as the color of the Skylight (check "Use scene environment"). Set the intensity multiplier to 0,8. Create a new "Target light" light and position it similarly to Fig. 22 (but that's really up to your tastings). Set the "Light cone" to a value high enough to cover the entire scene, and set the color of the light to be a soft yellow/orange (ie 252.240.218). Set the shadow type to "Area shadows" to get a much more realistic effect, setting the type to "Disc light" and the dimensions to an acceptable value (in my case 100x100, just do a couple of test render to get proper soft shadows).
Now create a small plane under the bonnet, big enough to receive the shadows, and assign it a "Matte/Shadow" material, leaving the various parameters to their default values. Open the "Advanced lighting" panel (menu Rendring > Advanced lighting") and activate the "Light tracer" plugin, leaving the parameters to their default values. The discussion of the many parameters of this panel is beyond the scopes of this tutorial, anyway the default values give almost always acceptable results, then it's up to you to tweak the various values to get the best solution in terms of quality/speed, based on your scene setup.
Launch a new render, and you should get a result similar to Fig. 23, otherwise i failed in explaining this tutorial, or you read it without enough care ;-)

Section 7: Conclusions

This finally concludes this long 2 parts tutorial, modelling and rendering a detailed Nissan R390 GT1: such a project, as i wrote in the preface, requires carefull plannings and a lot of patience. Experience plays a fundamental role in every part of the process: the modelling and rendering setup of the Mini Cooper in Fig. 21 took me about half the time i needed for the Nissan.
My hope is that this reading has been helpfull for the 3d community, and that i gave some help to speed up the learning process with a tutorial as detailed as i could without writing a whole book. I tried to highlight the most common problems i face when modeling a car: there's always some new obstacle each time, you know that damn surface or crease which just doesn't look right...Anyway with some time and dedication you can always get what you want. As always, i tried to be as clear as possible, but first of all i am not english so some parts might be badly translated, and i might have omissed some explanation which i thoughts were not necessary: feel free to mail me at enrico@enriconencini.com for any question or suggestion, i'll be more than happy to get in touch with anybody, if free time is enough ;) That's it, have fun and take care...

Fetching comments...

Post a comment