26
Copyright © 2015 - Curt Hill Meshes A Little More to Know

Copyright 2015 - Curt Hill Meshes A Little More to Know

Embed Size (px)

DESCRIPTION

What is a mesh? A group of polygons with edges in common that compose a three dimensional shape –The polygons contain vertices and edges –A polygon also has a face The mesh may enclose a three dimensional irregular solid or just be a shell The more polygons –The finer the detail –The more work to render Copyright © Curt Hill

Citation preview

Page 1: Copyright  2015 - Curt Hill Meshes A Little More to Know

Copyright © 2015 - Curt Hill

Meshes

A Little More to Know

Page 2: Copyright  2015 - Curt Hill Meshes A Little More to Know

Copyright © 2015 - Curt Hill

Introduction • Here we find out what a static

mesh actor really is• We will also get a brief introduction

to the Material Editor

Page 3: Copyright  2015 - Curt Hill Meshes A Little More to Know

What is a mesh?• A group of polygons with edges in common that compose a three dimensional shape– The polygons contain vertices and

edges– A polygon also has a face

• The mesh may enclose a three dimensional irregular solid or just be a shell

• The more polygons– The finer the detail– The more work to render

Copyright © 2015 - Curt Hill

Page 4: Copyright  2015 - Curt Hill Meshes A Little More to Know

Polygon Count• AKA Polycount• Games typically use a much smaller

polycount than movies– Games need to be rendered in real-time

while a movie does not need this speed• Modern GPUs know about these

polygons– The number they can process is one of

the ways to rate them• In a game, we must balance speed

with detailCopyright © 2015 - Curt Hill

Page 5: Copyright  2015 - Curt Hill Meshes A Little More to Know

Copyright © 2015 - Curt Hill

Pictures

Page 6: Copyright  2015 - Curt Hill Meshes A Little More to Know

UDK and Meshes• UDK does not create meshes• They function as a template

– Many copies may be placed in a level– These come from a 3D modeling

program• In the editor they may be moved,

scaled and covered with material • A static mesh is composed of more

than just polygonsCopyright © 2015 - Curt Hill

Page 7: Copyright  2015 - Curt Hill Meshes A Little More to Know

Static Mesh Pieces• The first component is a polygonal

mesh• What is not obvious is that there

are other things• The collision mesh• Material

– Either the default or a proper covering• UV Sets

– However materials need to be explained as well

Copyright © 2015 - Curt Hill

Page 8: Copyright  2015 - Curt Hill Meshes A Little More to Know

Collision Mesh• A simplified containing mesh

– Simplified to make computations easier• Will detect a collision when in real life

the items would be close but not collide

• A simple cube mesh is not substantially different than its collision mesh

• The more complicated the mesh the more the collision mesh is simplified

Copyright © 2015 - Curt Hill

Page 9: Copyright  2015 - Curt Hill Meshes A Little More to Know

Collision Mesh

Copyright © 2015 - Curt Hill

Page 10: Copyright  2015 - Curt Hill Meshes A Little More to Know

Materials• We are only interested in a polygon if

we can see it– What we see is the polygon face

• A polygon may express the physical detail of a mesh but it is boring

• Thus we map a material onto the mesh– You have seen the default material

• When we do each face has an image superimposed on it– This tends to obscure the edges

Copyright © 2015 - Curt Hill

Page 11: Copyright  2015 - Curt Hill Meshes A Little More to Know

What is a material?• Strictly speaking it is an algorithm• A material may contain one or

more textures– A texture is just an image

• A material also defines how light reflects off of the face– How the material interacts with the

light– Glossy or matte are two examples

Copyright © 2015 - Curt Hill

Page 12: Copyright  2015 - Curt Hill Meshes A Little More to Know

Channels• The material algorithm uses as its

input a set of channels• Each channel defines a certain

quality that is visually apparent• These channels operate on the

pixels• Since pixels are just integers,

representing RGB and Alpha, they may modified with simple mathematical operations

Copyright © 2015 - Curt Hill

Page 13: Copyright  2015 - Curt Hill Meshes A Little More to Know

Channel Types• Diffuse – Original image or texture

• Specular– Reflectivity or shininess - depends on the

light and relative position• Normal

– Used to create surface effects such bumpiness

• Emissive– How much light does this produce

• Opacity – determines transparency• Others as well

Copyright © 2015 - Curt Hill

Page 14: Copyright  2015 - Curt Hill Meshes A Little More to Know

UV Mapping• The texture that is part of the

material is a 2D plane which has to be applied to 3D surface

• This is known as a mapping• The two axes of the planar image

are the U (horizontal) and V (vertical)– Hence UV Mapping

Copyright © 2015 - Curt Hill

Page 15: Copyright  2015 - Curt Hill Meshes A Little More to Know

Material Editor• Since we are creating a new

algorithm from pieces it can get rather complicated

• Uses the same sort of graph approach as Kismet

Copyright © 2015 - Curt Hill

Page 16: Copyright  2015 - Curt Hill Meshes A Little More to Know

Select a Material

Copyright © 2015 - Curt Hill

Page 17: Copyright  2015 - Curt Hill Meshes A Little More to Know

Right Click

Copyright © 2015 - Curt Hill

Page 18: Copyright  2015 - Curt Hill Meshes A Little More to Know

Material Editor

Copyright © 2015 - Curt Hill

Page 19: Copyright  2015 - Curt Hill Meshes A Little More to Know

Working Areas• Material Editor has several main

working areas• Menu – top • Preview pane – left • Property pane – bottom• Graph pane – middle• There are others not shown

– Source code

Copyright © 2015 - Curt Hill

Page 20: Copyright  2015 - Curt Hill Meshes A Little More to Know

The Graph

Copyright © 2015 - Curt Hill

Page 21: Copyright  2015 - Curt Hill Meshes A Little More to Know

The Channels

Copyright © 2015 - Curt Hill

Page 22: Copyright  2015 - Curt Hill Meshes A Little More to Know

Finally on Materials• You thought that the material

covering was simple!• We will come back to the material

editor when we look at a simple application– Materialing speedtree vegetation

Copyright © 2015 - Curt Hill

Page 23: Copyright  2015 - Curt Hill Meshes A Little More to Know

Static Mesh• Finally we know what a static mesh

is• It is:

– an invisible polygon mesh – Wrapped in a visible UV map– Contained within an invisible collision

mesh• Some of these may be absent

– You have seen: no collision model– You have also seen the default material

Copyright © 2015 - Curt Hill

Page 24: Copyright  2015 - Curt Hill Meshes A Little More to Know

How is this different than CSG?

• CSG is typically simple shapes– Planes, cones spheres– These cannot be moved or destroyed

• Static meshes are usually much more complicated – They are made outside of UDK– They may become part of a static

mesh actor

Copyright © 2015 - Curt Hill

Page 25: Copyright  2015 - Curt Hill Meshes A Little More to Know

Static Mesh Actor• Usually a prop in the world

– Cannot be damaged– Does not move much, although can

be animated with Kismet/Matinee• We may also derive a new Actor

object and it refers to this static mesh– Then we may animate with

UnrealScript

Copyright © 2015 - Curt Hill

Page 26: Copyright  2015 - Curt Hill Meshes A Little More to Know

Conclusion• Although we have been using

static meshes from the first creation of a level we did not know much about them– Now we know slightly more

Copyright © 2015 - Curt Hill