asteroid tutorial

Upload: bryan-robb

Post on 10-Apr-2018

246 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Asteroid Tutorial

    1/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_1.html[10/8/2010 5:26:38 AM]

    Creating Asteroids

    Tools Used: 3ds MAX 4.2 (most of this material should applyto earlier versions of max)Texporter - for exporting mapping coordinates to an image

    A few months ago, I was given a project: design 10-15asteroids, appropriate for use in a real-time 3d space shootergame. My requirements were: each asteroid should be 4,000 -8,000 polygons (to be scaled down in-game), have its owntexture map (up to 512x512), and have minimal texturestretching and seams. This tutorial explains how I achievedthis.

    This tutorial is NOT meant for novice MAX users. It involvesusing a fairly large number of tools and plugins, and I simplycannot explain the workings of each of them. I did, however,separate the steps in this tutorial into two categories - crucial,and optional. The optional steps are often more complicated,but they're the details I couldn't find in any other tutorials,

    and they're the reason for this tutorial's existence. They'recolored yellow. So follow all the steps if you can, but if you'rehaving trouble, start with the basics.

    Note: Some of the images have been scaled down, to fitbetter on the page. Simply click an image to bring up the full-resolution version.

    Without further adieu, load up Max, and we'll begin!

    http://www.cuneytozdas.com/software/max/texporter/http://www.cuneytozdas.com/software/max/texporter/
  • 8/8/2019 Asteroid Tutorial

    2/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_1.html[10/8/2010 5:26:38 AM]

    Next: Basic Asteroid Shape

    www.waylon-art.com

    [email protected]

    http://www.waylon-art.com/mailto:[email protected]:[email protected]://www.waylon-art.com/
  • 8/8/2019 Asteroid Tutorial

    3/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_2.html[10/8/2010 5:26:59 AM]

    Basic Asteroid Shape

    1) Startwith ageosphere.Give it aradiussomewherebetween 80and 90, and5 segments.(The radiusisn'timportant,

    except thatit worksbetter withthe examplevalues Igivethroughoutthis tutorial.I gave itfivesegments

    because Iliked thepolygoncount thisresulted in.)

    2) Add a"Noise"modifier.This gives

    the asteroidits basicshape. Typein a scale ofabout 80and strengthvalues of60, 50, and40 for theX, Y, and Z

  • 8/8/2019 Asteroid Tutorial

    4/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_2.html[10/8/2010 5:26:59 AM]

    strengths,respectively.Now playwith theseed valueuntil youfind a shapeyou like.

    (Putting indifferentvalues forthe X, Y,and Z scalesgives theasteroid asomewhatless uniformshape. Thenumbers I

    picked justhappened towork wellfor me, butplay withthem a bit ifyou don'tlike theresults theygive.)

    3) Add ameshsmoothmodifier.This willsmooth outthe mesh,give youmorepolygons towork with,

    and allowyou tofurthershape themesh if youwant to. Setthe"Iterations"value to 3,and you're

  • 8/8/2019 Asteroid Tutorial

    5/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_2.html[10/8/2010 5:26:59 AM]

    on yourway!(Setting"Iterations"higher orlower willgive youmore or lesspolygons towork with.)

    AdvancedIf you wantmore controlof yourmesh: In

    the "LocalControl"section, clickon the"vertex"icon just tothe right ofwhere itsays"SubobjectLevel". This

    will displaya bunch ofcontrolpointsacross themesh, whichyou canmovearound towarp the

  • 8/8/2019 Asteroid Tutorial

    6/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_2.html[10/8/2010 5:26:59 AM]

    geometry.Be sure toplay aroundwith SoftSelection abit, since itcan reallyspeed up

    yourmodeling.

    Also, notethat withthe noisemodifier, themesh will bemore or lesssymmetric

    across oneaxis. You'llwant tomanuallyadjustcontrolpoints tomake thislook better.

    4) You're done with the basic shape of your asteroid! Now it'stime to add some details...

    Next: Adding Details

    www.waylon-art.com

    [email protected]

    http://www.waylon-art.com/mailto:[email protected]:[email protected]://www.waylon-art.com/
  • 8/8/2019 Asteroid Tutorial

    7/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_3.html[10/8/2010 5:27:17 AM]

    Adding Details

    1) First,we're goingto add somecraters usingDisplacementMaps. Forthisexample, Iused a fewdifferentbitmaps,including

    single cratersandcollections ofmultiplecraters. Ifyou like, youcan use thedisplacementmaps I'veprovided, or(obviously)

    you canmake yourown.

    2) Add a"Displace"modifier. Setthe strengthto -100, andthe decay to

    20. Under"Bitmap",click on thebuttonlabeled"None", andgo find thedisplacementmap youwant to use.

  • 8/8/2019 Asteroid Tutorial

    8/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_3.html[10/8/2010 5:27:17 AM]

    In the "Map"section, typea value in"Length" and"Width". Ityped 200for thiscrater, but

    you canchange thatto makeyour craterbigger orsmaller.(Setting the"Decay"value tosomethingother than 0

    helps makesure thecraterdoesn't alsoend up as abulge on theother side oftheasteroid.)

    3) Now youget toposition yourcrater. Aneasy way todo this is torotate theperspectiveview untilyou'relooking

    "down" atthe asteroidfrom thedirection youwant thecrater to beapplied. Inthe"alignment"section of

  • 8/8/2019 Asteroid Tutorial

    9/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_3.html[10/8/2010 5:27:17 AM]

    the modifier,click "ViewAlign". That'llpoint thecrater in therightdirection, butyou still

    need fine-tune theposition.

    4) Go intosub-objectmode for thegizmo (Clickon the word"Displace" in

    yourmodifierstack). Setthe"ReferenceCoordinateSystem"dropdown to"local". Now,move thegizmo in the

    Z-axis sothat it's justbarelyresting onthe surfaceof theasteroid -this will giveyou controlof how"deep" the

    craterappears. Youcan movethe craterleft and rightby movingthe gizmo inthe x- andy-axes.

  • 8/8/2019 Asteroid Tutorial

    10/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_3.html[10/8/2010 5:27:17 AM]

    5) Here, Iadded adisplacementmap with afew cratersin it. Thesettings, forthe most

    part, are thesame.

    6) Afteryour asteroidis sufficientlycratered,I've foundthat it's niceto add a few

    more noisemodifiers, togive it a littletexture. Theproblem withnoise,though, isthat it's veryuniform - allthe bumps itcreates have

    a very evendistribution,even withfractal noiseenabled.

    7) To getaround this,add twonoisemodifierswith differentscale andstrengthvalues, andpossiblycheck"Fractal" forone of them.This will

  • 8/8/2019 Asteroid Tutorial

    11/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_3.html[10/8/2010 5:27:17 AM]

    make it looka little morerandom. Thevalues I usedin theexampleworked outpretty well,but asalways, play

    around withthem untilyou findsomethingyou like.

    Next: Mapping Coordinates

    [email protected]

    http://www.waylon-art.com/mailto:[email protected]:[email protected]://www.waylon-art.com/
  • 8/8/2019 Asteroid Tutorial

    12/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    Simple Mapping Coordinates

    1) Giving the asteroid really good UVW coordinates is a pain in thebutt. For this project, I needed to minimize both the amount ofstretching and the number of seams that the asteroid has. Amongother things, this makes texture mapping the object a lot easier.Unfortunately, setting up good mapping coordinates is pretty involved.If you'd rather just get the damned thing mapped, follow theinstructions in this section. But if you want to do a really good job,skip ahead to "Advanced Mapping Coordinates."

    2) Start bymaking a new

    material, andgive it atexture mapthat's just ablack andwhitecheckerboard...Make sure it'san actualbitmap (don'tjust give it a

    "checker"material), andclick the "ShowMap inViewport"button. Acheckerboardtexture is areally usefultool for findingstretched

    mappingcoordinates,and I use it onnearly everyobject I needto UVW map.

    3) Apply thatcheckerboard

  • 8/8/2019 Asteroid Tutorial

    13/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    material toyour asteroid,and add aUVW Mappingmodifier. Atthis point, ifyou want tominimize

    seams,"Spherical" isthe bestmappingmethod, and ifyou want tominimizestretching,you'll want touse "Box"mapping.

    There. You'redone! But ifyou usedsphericalmapping, lookat how thetexture is allbunched up atthe top, andhow stretchedit gets around

    the edges. Orwith boxmapping, lookat how uglythose seamsare. That's notgood at all!Cylindrical andplanarmapping havesimilarproblems, so ifyou REALLYneed to do agood job,here's how:

    Advanced Mapping Coordinates

  • 8/8/2019 Asteroid Tutorial

    14/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    1) What we want to do is to minimize both seams and stretching. Wecan do this by splitting the asteroid in half, and unwrapping each halfseparately - creating only one seam, and causing fairly littlestretching. If you followed the instructions in the "Simple MappingCoordinates" section, get rid of that UVW modifier, and go into your

    material and disable "Show Map in Viewport". We need to do somemore work first, and a poorly mapped checkerboard texture will justget in the way.

    2) First thingsfirst, we needto divide theasteroid inhalf. Add anEdit Mesh

    modifier, andgo into Polygonmode. (Hit F4to turn on"Edged Faces")Change theselection typefrom"RectangularSelectionRegion" to

    "FenceSelectionRegion". Find anice seamhalfwaythrough yourobject, andselect half ofyour asteroid,following asclosely as

    possible to theseam.

    3) There, nowhalf of yourobject shouldbe red. If youlook closer, theselection will

  • 8/8/2019 Asteroid Tutorial

    15/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    follow theseam prettynicely in someareas, butyou'll need totouch it up alittle. Beforeyou begin,

    check the"IgnoreBackfacing"box - that way,if you deselectfaces on oneside of theobject, youwon'taccidentallydeselect the

    ones on theother side aswell.

    4) Now, goaround theobject,selecting anddeselectinggroups of faces

    so that theselectionboundaryfollows yourseam. (Hold"ctrl" to add tothe selection,and "alt" toremove fromit.)

    5) Your seamshould looknice all theway around.To make surethat you got allthe right faces,you may wantto hit "delete",

  • 8/8/2019 Asteroid Tutorial

    16/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    look to makesure therearen't anystray polygonsfloatingaround, thenhit undo whenyou're sure it

    looks good.When you'redone with that,change thematerial ID forthe selectedfaces - it'llmake it a loteasier to keeptrack of thetwo halves of

    the asteroidlater on. Witha GeoSphere,the defaultmaterial ID is2, so change itto 1 for theselected faces.Now, we'rejust aboutready to add

    some UVWmapping.

    Advanced- There are anumber ofthings you cando at this pointto makemapping yourasteroid easier.All of them,however,involvemessing withthe geometry -and at somelater point,you'll need tobe able to

  • 8/8/2019 Asteroid Tutorial

    17/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    revert theasteroid to thestate it's inright now,while keepingthe finalizedUVWcoordinates. AMorph objectwill worknicely, but fornow, all youneed to do ismake a copy of

    the asteroidand hide it forlater.

    - Mapping the object can be easier if you go back and delete some ofyour displace modifiers, since craters can mess with your mappingcoordinates. If you have really wacky geometry, you might also wantto add another edit mesh modifier to push and pull some vertices ifthere are any real problem areas.

    - Adding a"Spherify"modifier at thispoint will alsoimprove theoutcome ofyour mapping,and it will helpyou findproblem areas

    in the mesh.You can fixthese problemsby going backand forth withtheaforementionededit meshmodifier, butthat's not

  • 8/8/2019 Asteroid Tutorial

    18/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    usuallynecessary.

    If you skipped the advanced section: In practice, I usually add aSpherify modifier, and do a couple other things to the mesh to makethe UVW mapping turn out a little nicer. As a result, in the next fewscreenshots, my asteroid looks like a sphere, while yours will still looklike an asteroid. Don't worry, everything works out the same nomatter what your asteroid looks like.

    6) At thispoint, it'suseful to havea checkerboardpattern on theasteroid. Ifyou're not surehow to do this,follow thedirections inStep 2 of the"SimpleMappingCoordinates"section.

    7) Add a MeshSelectmodifier, andgo into Polygonmode. Yourpolygonsshould still beselected, but ifthey're not,just type in thecorrectmaterial ID

    (probably 1)and click"select".

    8) Add a "UVWMapping"modifier. We'regoing to gowith "ShrinkWrap" mode

  • 8/8/2019 Asteroid Tutorial

    19/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    for this. Click"Fit", andchances are,the selectedhalf of yourasteroid willlook prettygood. (You

    may be able toget betterresults bymoving themapping gizmoup and down.To do this,click on thewords "UVWMapping" inyour modifier

    stack, andmove thegizmo in the z-axis.)

    9) Note: Afterthe last step,your mappingmay look kindof wacky,

    depending onwell, a fewdifferentthings. If yourmapping lookslike theexample, clickon "UVWMapping" inyour modifierstack to go

    into gizmomode, thenclick and thenright-click the"rotate" tool tobring up the"RotateTransformType-In"panel. Type in

  • 8/8/2019 Asteroid Tutorial

    20/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    "180" for they-axis under"Offset: Local".This will fix the

    messed upmappingcoordinates. Ifyour mappinglooked correctto begin with,don't worry,you'll have todo this stepafter you'vemapped the

    other half ofyour asteroid.

    10) Add another mesh select modifier, go into polygon mode, typethe material ID of the other half of the polygons (probably 2), and hit"Select".

    11) Addanother UVW

    mappingmodifier. Set itto shrink wrap.Hit "fit". If youskipped step12 before,you'll likelyneed to do itnow.

    AdvancedIf you playedwith thegeometry ofthe asteroidbefore, you'llneed to morphit back to thecorrect shapenow. Un-hide

  • 8/8/2019 Asteroid Tutorial

    21/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    the earlierversion of themesh, go tothe "Create"panel, andchange from"StandardPrimitives" to

    "CompoundObjects". Makesure the fullyUVW-mappedasteroid isselected, andclick on"Morph". Then,click "picktarget" andclick on the

    correctly-shapedasteroid. Yourasteroid shouldnow have goodmappingcoordinatesand have thecorrectgeometry. (Youcan delete the

    extra asteroidnow, if youwant.)

    12) Yay!You're almostdone. The lastthing we needto do is tomake sure

    none of themappingcoordinatesfrom the twohalves of theasteroid areoverlapping.First, add a"UVW Xform"modifier, and

  • 8/8/2019 Asteroid Tutorial

    22/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    set the "V Tile"

    to 0.5. (Thiswill effectivelychange ourtexture mapfrom a square,say 256x256,to a rectangle,128x256. It'sjust a betteruse of texturespace for this

    object, andminimizesstretching.)

    13) Now addan "UnwrapUVW" modifier,click on "Edit",and at thebottom, whereit says "AllIDs", selectonly thematerial ID ofthe top half ofthe asteroid(probably 1).Select all thevertices, andmove them up

    and out of theway -preferably outof the box.Now switch tothe othermaterial ID (2?), select allTHOSEvertices, andmove them to

  • 8/8/2019 Asteroid Tutorial

    23/24

    roid Tutorial

    //waylon-art.com/tutorial/tutorial_4.html[10/8/2010 5:27:50 AM]

    the bottom ofthe box. Switchback to "AllIDs", and you

    can move andscale bothhalves of theasteroid sothat they fitinside the box,making surethey don'toverlap.

    14) You're done! Get texporter to output the uvw coordinates to animage (or just hit alt-printscreen while in the "unwrap UVW" modifier,then paste into Photoshop.) Paint your texture, and voila! A beautifulasteroid.

    Next: Finishing Touches

    www.waylon-art.com

    [email protected]

    http://www.cuneytozdas.com/software/max/texporter/http://www.waylon-art.com/mailto:[email protected]:[email protected]://www.waylon-art.com/http://www.cuneytozdas.com/software/max/texporter/
  • 8/8/2019 Asteroid Tutorial

    24/24

    roid Tutorial

    Finishing Touches

    1) When I created my asteroids, after finishing with the UVWmapping, I applied a plugin called DirtyReyes from Reyes-

    Infografica to the mesh. That gives a nice base to work fromwhen you're making your texture map. I also used a handydandy plugin called TLUnwrap, which, among other things,can unwrap a DirtyReyes texture to the mapping coordinatesyou spent so long setting up. If you use this, when you createyour DirtyReyes material, be sure to set the self-illuminationto 100% or it won't look right. You'll know what I'm talkingabout if you play with these plugins for a bit.

    2) I'm a big fan of layering all kinds of crazy images inPhotoshop to make a good texture. I won't go into details, but

    suffice to say, when I was done, there was a pretty noticeableseam running around my asteroid. There's a plugin calledDeep Paint 3D, from Right Hemisphere, which is a great toolfor removing seams like these AND it has a free trialversion! I don't feel like writing a tutorial on it though, so gofigure it out for yourself.

    3) I used Max's built-in MultiRez modifier to drop the polygoncount of the asteroid down to something more appropriate forthe game. You may need to do this too, depending on whereyou plan to use your asteroid.

    -----

    I hope you learned something from this tutorial. If you haveany questions, or if anything is particularly unclear, please,write to me. Also, if you know of an easier way of doing anyof this, I'd REALLY like to hear from you!

    - Waylon Brinck

    Back to the begninning

    www.waylon-art.com

    [email protected]

    http://www.reyes-infografica.net/dirty.phphttp://www.reyes-infografica.net/http://www.reyes-infografica.net/http://www.elforo.com/mankuacf/plugin_info.cfm?plug=2http://www.us.righthemisphere.com/products/dp3d/index.htmhttp://www.us.righthemisphere.com/http://www.waylon-art.com/mailto:[email protected]:[email protected]://www.waylon-art.com/http://www.us.righthemisphere.com/http://www.us.righthemisphere.com/products/dp3d/index.htmhttp://www.elforo.com/mankuacf/plugin_info.cfm?plug=2http://www.reyes-infografica.net/http://www.reyes-infografica.net/http://www.reyes-infografica.net/dirty.php