PDA

View Full Version : how to do ---------Mini Cooper.


dynafx
22-06-2005, 12:36 AM
lots of tantrics trying out, bikes & cars, recently, so posting
this tutorial by bencowel  to get some perfection in their work,
hope it helps <img src="smileys/smiley17.gif" border="0"><br>
<br>
---------------------------------------------------------- --------------------------------------- <br>
<img src="http://www.rethinkfx.com/tutorials/mini_clean_big.jpg" border="0"><br>
<img src="http://www.rethinkfx.com/tutorials/mini_front_big.jpg" border="0"><br>



<p><strong>Behind the scenes shading and rendering my Mini Cooper. </strong></p>


<p><img src="http://www.rethinkfx.com/tutorials/bonnet.jpg" height="400" width="500" border="0"> </p>


<p><strong>Introduction</strong></p>


<p>This article focuses on shading and texturing the Mini Cooper, I?ll
talk a little about rendering with Mental Ray but I think other people
have covered that in more depth elsewhere.</p>


<p><strong>Quick notes on modeling</strong></p>


<p>I?d wanted to build a cg car for a long time, but couldn?t
decide what model of car it would be. It was only after seeing a few New
Mini models I thought I?d have a crack at the original model. This
project would also be my first time using Maya so I didn?t worry
about taking my time. </p>


<p>The car was modeled in the conventional polygon manner; every element
was constructed from a single plane using the Connect Poly Shape tools
written by Dirk Bialluch. A great tutorial for this method of modeling
is available from Munkmotion : <a href="http://www.munkmotion.com/tutorials/nsx/" target="_blank" class="linkbody" target="_blank">http://www.munkmotion.com/tutorials/nsx/</a><br>
</p>


<p><img src="http://www.rethinkfx.com/tutorials/mini_build.jpg" height="344" width="500" border="0">
</p>
<p>As always good reference was the key, I decided to base my car on an
actual cooper. I found a fair few images of LRX 827E which I really liked
(Especially as it lacked the chrome grill surround).
</p>
<p><img src="http://www.rethinkfx.com/tutorials/67alpprep827e.jpg" height="320" width="412" border="0">
</p>
<p><strong>Rendering Research</strong>
</p>
<p>When I started work on the car I began also experimenting with the Mental
Ray add-on for Maya. To be honest it was pretty clunky and extremely slow.
The documentation was useless and there wasn?t much in the way of
tutorials of help on the web. I tinkered around with it and tried to understand
the Global Illumination and Final Gathering systems.<br>
</p>


<p><img src="http://www.rethinkfx.com/tutorials/mini_old_mr.jpg" height="400" width="500" border="0">
</p>
<p>I found the early implementation of Mental Ray for Maya extremely frustrating
and had almost given up when Alias got their act together and brought
out the new cleverly integrated free version. Although still tricky to
master this version was a lot faster.
</p>
<p><strong>Approach</strong></p>


<p>I decided fairly early on that the car should be muddy and dirty. This
mud would need to be textured onto the car from bitmaps, which would mean
huge file sizes if I wanted to render close-ups. I needed a system to
allow me to tile and reuse my mud textures so they could stand up to extreme
close ups.</p>


<p>Painting textures into simple Photoshop files and just applying them
to the car wasn?t going to work.</p>


<p>The solution I settled on was a fairly simple one, using masks to define
where the mud would lie on the car, and then mixing through to a mud shader
in those areas. The mud shader was mapped separately and could be tiled
and varied without affecting the paintwork.</p>


<p><a href="http://www.rethinkfx.com/tutorials/maskdia.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/maskdia.gif" border="0" height="209" width="500" border="0"></a>
</p>


<p>I separated the dirt into two layers a dark wet mud and a thinner dry
dust spray, each layer had its own mask for each body panel. The mud itself
was mapped globally to the whole car with a tri-planer projection map.
This way the mud would run from one panel to another neatly.</p>


<p>Mostly importantly this approach meant that I could deal with the look
of the mud separately from its placement.</p>


<p><strong>Painting masks</strong></p>


<p>Once I?d UV mapped each body panel I was really to paint my dirt
masks. I used Maya?s 3D paint system to paint myself guides on each
panel, and then exported these TGA?s out to Photoshop and painted
more finished versions.</p>


<p><img src="http://www.rethinkfx.com/tutorials/front_reference.jpg" height="166" width="500" border="0"></p>


<p>I also exported the UV coordinates at the same scale and put them into
the Photoshop file, this gave me exact reference of where my paint strokes
would appear on the car in Maya.</p>


<p>I then worked on two masks for each panel, a basic dry dirt mask and
a wet splatter mask:</p>


<p><img src="http://www.rethinkfx.com/tutorials/front_basic_dirt.jpg" height="166" width="500" border="0"></p>


<p>The black areas define where the mud will sit and the white where the
paint will be.</p>


<p><img src="http://www.rethinkfx.com/tutorials/front_splatter.jpg" height="166" width="500" border="0"></p>


<p>All the masks were hand painted and assembled from various sources. I
used a lot of concrete texture maps layered up and manipulated to create
the basic dirt masks.</p>


<p><strong>The paint shader</strong><br>
</p>


<p><img src="http://www.rethinkfx.com/tutorials/paint_attributes.jpg" height="625" width="467" border="0"></p>


<p>The red paint shader was fairly simple, although given the strange way
mental ray?s FG system seems to deal with shaders it took a lot
of tweaking to look right. All the lighting in the scene came from a HDRI
map.</p>


<p>The shader is a simple red Blinn with the diffuse component turned right
down to 0.4. The reflectivity and specular colour have a sampler info
node passing through a curve to really push the specularity when the metal
bends away from camera.</p>


<p><img src="http://www.rethinkfx.com/tutorials/specular.jpg" height="169" width="500" border="0"></p>


<p>&nbsp;</p>


<p>The curve looks like this :</p>


<p><a href="http://www.rethinkfx.com/tutorials/spec_curve.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/spec_curvesm.jpg" border="0" height="492" width="500" border="0"></a></p>


<p>It?s essentially turning the linear 0 -&gt; 1 output of the sampler
info?s facing ratio into a 0 -&gt; 2 exponential value.<br>
<br>
<img src="http://www.rethinkfx.com/tutorials/paint_spec.jpg" height="290" width="491" border="0"> </p>


<p>I use curves instead of ramps to do this as I?m used 3D Studio
Max?s way of doing things, but really it makes no difference how
it?s done.</p>


<p ="main"><strong>UPDATE</strong></p>


<p><strong>I</strong>'ve had a lot of emails asking me how on earth I use
curves in the hypershade, so I'll attempt to explain here.</p>


<p>1 - Go to frame 0. Create a blinn material, open up the attributes and
right click on the specular colour attribute. Select 'Set Key' from the
options. </p>


<p>2 - Now press show upstream and downstream connections and you should
see three animation curves powering the specular colour. Delete two of
the graphs.</p>


<p><img src="http://www.rethinkfx.com/tutorials/curve.jpg" height="210" width="500" border="0"></p>


<p>3 - You should have the same as I do above. Drag and connect the curve
to both remaining colour inputs on the specular colour.</p>


<p><img src="http://www.rethinkfx.com/tutorials/curveconnected.jpg" height="197" width="500" border="0"></p>


<p>4 - With the curve node selected open up the Graph Editor. You should
see just one single keyframe sitting at 0. If it's not at zero horizontally
(usually time), place it there. Create another keyframe at 1 and set the
value as 0.25.</p>


<p><a href="http://www.rethinkfx.com/tutorials/graph_big.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/graph.jpg" border="0" height="303" width="500" border="0"></a></p>


<p>5 - Now that all remains is the plug in the facing ratio from a sampler
info node. Create a sampler and drag to the animation curve, select 'other'
and connect the Facing Ration to the Input of the curve.</p>


<p>6 - Done !, you can play with the the values on the curve and check the
effects. </p>


<p><strong>Integrating Shaders</strong></p>


<p>Because all my muddy areas were defined by masks I could tweak the actual
look of the mud over the whole car without having to keep going back to
Photoshop. I mapped the two types of mud over the entire car as a Tri-planar
projection, and then experimented with adding gradients to have the mud
at the bottom of the car darker (wetter) than at the top.</p>


<p>Many of the settings on my shaders were connected to a control object
in the scene, by changing those settings I could alter the look of the
paint and mud instantly. These global controls really sped up the process
at the end, even if they made duplicating shading networks a pain.</p>


<p><img src="http://www.rethinkfx.com/tutorials/muddy_bonnet.jpg" height="400" width="500" border="0"></p>


<p>An early experiment using a different type of mud. This looked like someone
had chucked a bucket of wet concrete on the bonnet.<br>
<br>
<strong>Rendering</strong></p>


<p>As you?d expect rendering took a long long time. My frames were
averaging one hour on a 3Ghz machine, and I ended up rendering an animated
sequence of about 1000 frames !. I was lucky to get the use of the machines
in work.</p>


<p>Mental ray had some serious flickering and crawling issues. Setting the
final gathering min and max radius correctly really helped prevent this.
According to the mental ray information I found the max radius should
be set to 10% of the scene width, and the min radius should be 10% of
that. I ended up with 20max and 2min</p>


<p>I also played with the BSP settings to speed up render time, I?ve
no idea why but I had most luck with BSP size set to 16, BSP depth set
to 60 and BSP max memory set to 0.</p>


<p>Some renders still had a little flickering so I had to render out small
fix up patches to place over those areas.</p>


<p>So there you have it, a little bit of behind the scenes info on the shading
and rendering of my Mini Cooper.<br>
</p>


<p><a href="http://www.rethinkfx.com/tutorials/mini_top_big.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/mini_top_sm.jpg" border="0" height="160" width="200" border="0"></a><a href="http://www.rethinkfx.com/tutorials/mini_clean_big.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/mini_clean_sm.jpg" border="0" height="160" width="200" border="0"></a><a href="http://www.rethinkfx.com/tutorials/mini_front_big.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/mini_front_sm.jpg" border="0" height="160" width="200" border="0"></a><a href="http://www.rethinkfx.com/tutorials/wheel_big.jpg" target="_blank" target="_blank"><img src="http://www.rethinkfx.com/tutorials/wheel_sm.jpg" border="0" height="160" width="200" border="0"></a><br>
</p>
<p>http://www.rethinkfx.com/tutorials/cooper.htm<br>
</p>
<br>