[英文]用maya制造环形跑道(建模和材质)

Modelling and Texturing a Racing Circuit in Maya
Part One Racetrack environment creation has been my staple diet for the last eighteen months as I have been working on Total Immersion Racing, at Empire Interactive’s Razorworks studio based in Oxford. Razorworks, renowned for their Apache helicopter flight simulatio  on the PC, decided to take simulation into the racing genre, albeit with an arcade twist. The result is a multi-platform racing game containing real lice ed GT cars and a number of racetracks, both real and fictional.
I joined the company at the early stages of development and have focused soley on track design and creation. For TIR I helped to develop two real circuits, which required a keen eye for real world accuracy, plus two invented circuits where I could let my imagination flow a little!
This tutorial concentrates on the proce es involved with geometry co truction and texturing of a typical polygonal racetrack environment that could be run within the TIR game engine. During the development of the game, it became clear that we were generating our own in-house style for the track creation, and many of the stages you see here are the result of hours of refinement to streamline the proce . The track itself is one that unfortunately did not make it to the final build of the game but is a simple example that is useful to show track building techniques.
CREATING THE BUILD CURVES



(1) Seeing as the overall track distance is in kilometers, the first step is to set the units within Maya to meters. This is found in the Settings tab of the Preferences Optio , found in the Window menu. Then import the track design in the top view as an image plane, which can be acce ed in the top view’s View menu.
Click here to acce  the track design as seen in the scree hot above

(2) Using either the EP or CV NUR  tools set to a 3 cubic curve degree, trace the centreline of your track starting at the point where you would expect the start/finish line to be, usually o osite the pit lane. When completed, do not join the start and end points of the curve – overlap them slightly.




(3) Depending on your skills at drawing NUR  curves, you may need to modify the CVs or E  on the curve. Try not to have any tur  that are too sharp and make sure the curve is smooth and co istent. You may need to delete points or add more using the I ert Knots Tool.




(4) Use the Arc Length Measure Tool found in the Create menu and position it along the curve until you reach the overla ing end point. This is the distance of the circuit in metres and depending on your original image scale could be large or small.




(5) Scale the curve, up or down, until the arc length value is about 3840 then  ap the end point to the start point of the curve. The total circuit length will then be a roximately 3.84Km. Notice how this value is a multiple of 2 – you will see why I have chosen this later.




(6) Add height to the track by moving the CVs in the Y axis – made easier by selecting in the top view and moving in a side or front view. Notice in the track design, a 30 metre maximum height difference of the two small downhill sectio , and the longer sweeping uphill.




(7) Offset Curve 3 times either side of the centreline. The track width will be 13m so offsetting four lines  6, -6,  6.5, -6.5, will compe ate for the edge of the tarmac and the white line. Then offset twice again  9.5, -9.5 that will act as the outer edge of the gra  verge.



(8) Again using the Arc Length Tool mark out the centreline a rox. every 128m. Notice how I chose 3.84km as the track length. This will e ure that the circuit has 30 sectio  of 128m. This simplifies the modelling for purposes of this tutorial.




(9) In the top view, use a 1 cubic curve, and mark out lines perpendicular to the centreline positioned at every 128m marker. Then select all curves in the top view and Cut Curves selecting in the optio  box, to cut At All Intersectio  and keep All Curve Segments.



REBUILDING, LOFTING, TEXTURING

(10) In areas on the track where there are severe tur , like at a chicane, you may wish to fine tune the 128m sectio  by  litting them again into smaller sectio  of 32m, 64m, or 96m. This will make the eventual  a  cleaner as shown in the image above.




(11) Select all the 128m curve sectio  and choose Edit Curves – Rebuild Curves with settings set to Uniform, 3 cubic degree and 32  a . On the smaller sectio  simply modify this to suit, e.g a 32m section would have 8  a . This will give the final polygon sizes a width of a rox. 4m.




(12) In racing games found on next generation co oles, due to the increase in polygon usage, racing circuits look smooth around corners and not too jagged. You can smooth out curvy sectio  of the track double the  a  when rebuilding, e.g. 32m curvy section would have 16  a .




(13) At this point you should now have all the relevant curves in which to create some surfaces! At this point is a good idea to start organising your workflow. My favourite way is using Maya’s layers found in the Layer Editor. Set up a new layer called “curves” and add the curves to the layer.




(14) Moving around the track select the two curves that make up each surface and use the Loft command found in the Surfaces menu to create a lofted NUR  surface. Always select the curve on the right first to e ure the correct surface direction. Turning on backface culling in the viewport Shading menu will help.




(15) Now we have 3 types of surface, so we need the textures to fit the surfaces that all join together smoothly. For this create a tarmac texture (256x256pixels), a white line on tarmac texture (16x256), and a gra  with tarmac edge texture (128x256). The textures all need to join together with no seam, and be tileable vertically.




(16) In the Hypershader create three lambert shader grou  using the 3 textures. In the Place2dTexture node change the V repeat value to 16. This will e ure that per 128m surface section, the texture will tile 16 times – in other words each texture will cover two  a  on the surface in the V direction.



(17) But what about the other sectio  of 32m, 64m, and 96m? Simple – just create three duplicates of each shader group and change the repeats to 4, 8, and 12 re ectively. Its useful to use a naming convention for each so its easy to differentiate, e.g. Tarmac16, Tarmac12, Tarmac8 and Tarmac4.




(18) The next step is to a ign each shader to the relevant sized surface. At this point you may need to use the Reverse Surface Direction Optio  found in the Edit NUR  menu. Alternatively you can modify the UVs later once the NUR  have been converted to polys.



ADDING ENVIRONMENT

(19) Time to convert to polygo  at last! Use the Convert NUR  to Polygo  Optio  found in the Modify menu. Make sure the Type is set to Quads, Te elation Method is set to General, and the Initial Te elation Controls are set to Per  an 1 of Iso Params.




(20) The new polygon surfaces should match one to one between polygon and surface  an. At this point hide the NUR  surfaces away in a layer. Select all the polygon objects and combine them all, also merging the vertices using the tools in the Polygo , and Edit Polygo  menus. You now have the completed polygonal track ri on!




(21) Building the track in such a modular way gives a major advantage, in retaining the correct UVs. A good example of this is adding track edge kerbing on corners. Simply using the gra  verge texture, and add some ker  down one side. Et voila, when the texture is a igned to the polys it tiles beautifully!



(22) If you require any height tweaking – usually the result of playtesting the circuit, this can be added using the Wire Tool found in the Deform menu. This is e ecially useful if you want to add camber. Make the track ri on Live by selecting the red magnet button and draw on two curves either side of the track making sure you start and end the curves a good distance from the area you wish modified.




(23) Use the Wire Tool and make sure you increase the dropoff distance so that the tool actually has an effect. Modify the the two curves by raising and lowering the points, remember not to stray too near the end points or you may result in polygo  di lacing too much. One good way is using the side or front views to modify so you can see the smoothne  of the curve.



(24) To create the run off areas – usually in the form of sand tra  on most race circuits, you can either extrude the edge of the polygo , or go back to the original NUR  and offset a further distance. It doe ’t matter if the shape seems weird as you can trim down the polygo  later. This technique will already have the UVs in place so you could create a nice raked effect.




(25) Most racetracks have some kind of armco barrier system. The best way to handle this is to create a perfect set of barriers from your original NUR  curves and tweak their positioning later. You may need to rebuild the smaller sectio  that you originally smoothed out to have le   a  so they match the 32  a  in the 128m sectio . Using the curves you can extrude polygon surfaces.



(26) Combine all the barrier polygo , an a ly a front barrier shader group to them with repeats set to 16 U, and 3 V. Then duplicate the polygo  and reverse the normals and a ly a rear barrier shader group with the same settings. Barriers should now  ake around the track.




(27) Now you have created the most complex part, you can fill in the ga . You can either build the polys seperately using A end to Polygon, or perha  extrude edges. Or on a larger scale use tools like the Fill Tool found in the Edit Polygo  menu to fill large holes which you can  lit up or triangulate so you can sculpt the polys by moving around the poly components.





我也来说两句 查看全部回复

最新回复