IMGD : 3D Art b Mark Clapool (clapool@cs.wpi.edu Robert W. Lindeman (gogo@wpi.edu Outline The Pipeline Concept Art 2D Art Animation, Tiles 3D Art Modeling, Teturing, Lighting, Transformations (net Clapool & Lindeman - WPI, CS & IMGD 2
Polgonal Modeling Basics: Primitives Primitives are basic shapes Most 3d packages have same primitives: Sphere, Cube, Clinder, Plane Use for broad strokes Concentrate on primitives within object E: human bod (ovals for shoulders, clinders for legs, sphere for head Components are parts that make up primitive E: vertices, edges, triangles, faces, elements Similar across all packages but terminolog can var Transformation allows moving, rotating, scaling object or component Clapool & Lindeman - WPI, CS & IMGD 3 Polgonal Modeling Basics: Normals Face normals are at right angle to polgon Tell what direction if facing, how to render, how light will react Viewed from other side, is invisible Fine if on inside (sa, of solid cube When debugging, pa attention to normals as well as polgons Clapool & Lindeman - WPI, CS & IMGD 4 2
Polgonal Modeling Basics: Backface Culling Toggles displa of faces that point awa from view When on, see through wireframe When off, looks solid (not drawn Makes look less cluttered Clapool & Lindeman - WPI, CS & IMGD 5 Modeling Tools Certain tools and techniques used 8-9% of the time Line Tool: Draw outline of object and etrude to get 3-d shape E: profile of car. Use line tool. Then, etrude outward to get shape. Etrude: Take component (often face, duplicating it, pulling pushing or scaling to refine model E: take cube. Etrude face outward and smaller Cut: Subdivides faces and adds new faces Adjust: The artistic part of modeling. Tr to capture form, profile and character b moving vertices Verte surger, part of the technical manipulation Clapool & Lindeman - WPI, CS & IMGD 6 Based on Chapter 6.2, Introduction to Game Development 3
Modeling Technique: Bo Modeling Done for character, but can appl to other things General idea: Start with bo, clinder or other primitive Etrude, Cut, Adjust Get topolog, proportions right Once happ, refine until details complete Clapool & Lindeman - WPI, CS & IMGD 7 Bo modeling: Quick Eample Reference Bo modeling: etrude, cut, adjust Compare to reference Shade Clapool & Lindeman - WPI, CS & IMGD 8 Based on Chapter 6.2, Introduction to Game Development 4
Polgons and Limits 3d Software renders scene of polgons like game But 3d software slow (To Stor frame / 5 hrs Game is real time (3 frames / second Need to limit polgons. How spent depends upon world size and where needed. E: Medal of Honor versus Soul Caliber 2. MoH details spread across world, less on avatars. SC2 can have detailed avatars since onl 2 in one ring. Think of how man polgons each item needs. Estimates, educated guesses. Then, make pass. (Tools will often give count Used wisel, can make detailed scenes with few (E: 2.5, page 24 Ch 6.2 assumes 4 (tpical for PS2 street fighting game or hero in 3 rd person action game Clapool & Lindeman - WPI, CS & IMGD 9 Based on Chapter 2, Creating the Art of the Game, b Matthew Omernick Polgon Reduction ( of 4 Being able to model without wasting polgons important takes practice Ask if a plaer will see face? E: oil barrel as clinder. Will see bottom? Nope, then delete. Are all faces necessar? Looks great, eah, but some can be removed. E: 2-sided clinder still looks round with 8 sides? Then do it. (Eample eercise p3-3 Clapool & Lindeman - WPI, CS & IMGD Based on Chapter 2, Creating the Art of the Game, b Matthew Omernick 5
Polgon Reduction (2 of 4 Level-of-detail (LOD meshes Multiple versions of object, progressivel lower levels When far awa, use low level Assume more objects in Field of View When close, use higher level Assume fewer objects in Field of View Clapool & Lindeman - WPI, CS & IMGD Polgon Reduction (3 of 4 For entire level (ie- map with environment, entire polgon count matters Impacts amount of memor needed But onl visible polgons rendered Rest are culled and not computed Images courtes of WildTangent Clapool & Lindeman - WPI, CS & IMGD 2 Based on Chapter 6.2, Introduction to Game Development 6
Polgon Reduction (4 of 4 With low polgon modeling, much of the detail is painted into the teture (net topic! Images courtes of WildTangent, model and teture b David Johnson. Clapool & Lindeman - WPI, CS & IMGD 3 Based on Chapter 6.2, Introduction to Game Development Teture Shader define surface propert of object how shin, bump, how light effects Teture bitmap plugged into shader that defines image we want to appear on object Clapool & Lindeman - WPI, CS & IMGD 4 Based on Chapter 6.4, Introduction to Game Development 7
Detail in Teture Add depth, lines, etc. without polgons Bo is 2 polgons, bricks would take man more (Taken from http://www.mostert.org/3d/3dpdzscenem.html Clapool & Lindeman - WPI, CS & IMGD 5 Based on Chapter 6.4, Introduction to Game Development Lighting Can conjure feelings, emotions, even change what ou are seeing Reveal (or hide depth (Man books on traditional lighting AR/ID 35. LIGHT, VISION AND UNDERSTANDING Color, Mood Clapool & Lindeman - WPI, CS & IMGD 6 Based on Chapter 6.6, Introduction to Game Development 8
The Role of Color RTX Red Rock Color indicates danger Clapool & Lindeman - WPI, CS & IMGD 7 http://www.informit.com/articles/article.asp?p=7437 The Role of Lighting Long shadows not onl add to the atmosphere, but also help break up repetition Clapool & Lindeman - WPI, CS & IMGD 8 http://www.informit.com/articles/article.asp?p=7437 9
Lighting Setup ( of 3 Ke light main source. The Ke light is placed net to the camera, about 35-45 degree angle to the subject. The angle is determined b what kind of mood that ou want the scene to have. Clapool & Lindeman - WPI, CS & IMGD 9 http://www.3dtotal.com/team/tutorials/jenns3pt_tut/3ptlighting.asp Lighting Setup (2 of 3 Fill light Brings out some details out of shadow. Place the Fill Light at a 9 degree angle from the Ke Light, usuall slightl higher or lower than the Ke Light. Clapool & Lindeman - WPI, CS & IMGD 2 http://www.3dtotal.com/team/tutorials/jenns3pt_tut/3ptlighting.asp
Lighting Setup (3 of 3 Backlight - Highlights edges, pulls awa from background. Placed directl opposite the camera and behind the subject. Clapool & Lindeman - WPI, CS & IMGD 2 http://www.3dtotal.com/team/tutorials/jenns3pt_tut/3ptlighting.asp Working with 3D Lights Directional Lights used for sunlight or moonlight. Often as ke light. Predictable. Ambient Lights spread everwhere, equall. Uniform diffuse lights. Precise control over illumination. Spot Lights focus beam on single location. Great control. Point Lights single point in all directions. Light bulbs, candles, etc. Clapool & Lindeman - WPI, CS & IMGD 22 Based on Chapter 6.6, Introduction to Game Development
Eample of Working with 3D Lights Ambient light Clapool & Lindeman - WPI, CS & IMGD 23 Based on Chapter 6.6, Introduction to Game Development Effective Lighting Practices ( of 2 Pools of light Don t alwas tr to light evenl. - Gives sense of mster Pools of light in Indiana Jones: The Emperors Tomb Clapool & Lindeman - WPI, CS & IMGD 24 Based on Chapter 6.6, Introduction to Game Development 2
Effective Lighting Practices (2 of 2 Guide lights -Use light to guide the plaer. - Helps highlight areas that are accessible and important to the objectives. Clapool & Lindeman - WPI, CS & IMGD 25 Based on Chapter 6.6, Introduction to Game Development Introduction to Transformations A transformation changes an objects Size (scaling Position (translation Orientation (rotation Transform object b appling sequence of matri multiplications to object vertices Clapool & Lindeman - WPI, CS & IMGD 26 3
Hierarchical Transformations Graphical scenes have object dependencies Man small objects Attributes (position, orientation, etc. depend on each other hammer A Robot Hammer! lower arm base Clapool & Lindeman - WPI, CS & IMGD 27 Hierarchical Transformations Object dependenc description using tree structure Base Lower arm Upper arm Hammer Root node Leaf node Object position and orientation can be affected b its parent, grand-parent, grand-grand-parent, nodes Hierarchical representation is known as Scene Graph Clapool & Lindeman - WPI, CS & IMGD 28 4
Hierarchical Transformations Relative Transformations - Specif the transformation for each object relative to its parent Step : Translate the base (and its descendants b (5,, ; z z z Clapool & Lindeman - WPI, CS & IMGD 29 Hierarchical Transformations Step 2: Rotate the lower arm and (its descendants relative to the bases local ais b -9 degrees z z z Clapool & Lindeman - WPI, CS & IMGD 3 5
Hierarchical Transformations Base Translate (5,, Lower arm Rotate (-9 about its local Upper arm Hammer Appl all the wa down Appl all the wa down Clapool & Lindeman - WPI, CS & IMGD 3 Transformation uses Matrices All transformations can be performed using matri/vector multiplication Allows pre-multiplication of all matrices Note: point (, needs to be represented as (,,, also called homogeneous coordinates Clapool & Lindeman - WPI, CS & IMGD 32 6
Point Representation We use a column matri (2 matri to represent a 2D point General form of transformation of a point (, to (, can be written as: = a + b + c = d + e + f or a b c = d e f * Clapool & Lindeman - WPI, CS & IMGD 33 Translation To reposition a point along a straight line Given point (, and translation distance (t, t The new point: (, (, = + t = + t (, or P = P + T where P = P = t T = t Clapool & Lindeman - WPI, CS & IMGD 34 7
8 Clapool & Lindeman - WPI, CS & IMGD 35 33 2D Translation Matri t t = + use 3 vector t t = * Note: it becomes a matri-vector multiplication = + t = + t Clapool & Lindeman - WPI, CS & IMGD 36 Translation of Objects How to translate an object with multiple vertices? Translate individual vertices
9 Clapool & Lindeman - WPI, CS & IMGD 37 2D Scaling Scale: Alter object size b scaling factor (S, S. i.e., = * S = * S (, (2,2 S = 2, S = 2 (2,2 (4,4 = S S Clapool & Lindeman - WPI, CS & IMGD 38 33 2D Scaling Matri = S S = S S = * S = * S
2D Rotation Default rotation center is origin (, > : Rotate counter clockwise < : Rotate clockwise Clapool & Lindeman - WPI, CS & IMGD 39 2D Rotation (cont. (, Rotate about the origin b (, (, r φ (, How to compute (,? = r*cos(φ = r*sin(φ = r*cos(φ + = r*sin(φ + Clapool & Lindeman - WPI, CS & IMGD 4 2
2 Clapool & Lindeman - WPI, CS & IMGD 4 2D Rotation (cont. Using trigonometric identities (, (, φ r = cos( sin( = sin( + cos( Matri form? = cos( sin( sin( cos( φ φ φ sin sin cos cos cos( = + φ φ φ sin cos cos sin sin( + = + Clapool & Lindeman - WPI, CS & IMGD 42 33 2D Rotation Matri (, (, φ r = cos( sin( sin( cos( = cos( sin( sin( cos(
2D Rotation How to rotate an object with multiple vertices? Rotate individual Vertices Clapool & Lindeman - WPI, CS & IMGD 43 Arbitrar Rotation Center To rotate about arbitrar point P = (P, P b : Translate object b T(-P, -P so that P coincides with origin Rotate the object b R( Translate object back: T(P, P In matri form T(P,P R( T(-P,-P * P Pcos( sin( = P sin( cos( Similar for arbitrar scaling anchor P P Clapool & Lindeman - WPI, CS & IMGD 44 22
Composing Transformations Composing transformations Appling several transforms in succession to form one overall transformation Eample M X M2 X M3 X P where M, M2, M3 are transform matrices applied to P Be careful with the order! For eample Translate b (5,, then rotate 6 degrees is NOT same as Rotate b 6 degrees, then translate b (5, Clapool & Lindeman - WPI, CS & IMGD 45 23