程序代写CS代考 flex arm Computer Graphics

Computer Graphics
COMP3421/9415 2021 Term 3 Lecture 10

What did we learn last lecture?
A Deep Dive into Design and Art
● Some thoughts of Graphics and Art in general
● How Games are designed (and where graphics fits in)
● A look into the Art pipeline for digital assets

What are we covering today?
More detail on the Art Pipeline
● Continuing our overview of the Art Pipeline
● Going into a little more detail on:
● Modelling
● Rigging
● Animation

Developing a Character

Computer Games Art Pipeline
It’s a long process from idea to polygons
● Concept ● Design
● Pre-Production (Technical Graphics appears here)
● Post-Production (iteration may involve redoing earlier steps)
Today, we’re looking at Concept and Design
Various Production Images from Halo and Halo 2 (Bungie Studios and Microsoft 1999-2002)

Concept
We should have an idea of this now
● Have we given them a name? Should they have one?
● Is there any visual information yet? (probably not)
● Start doing research
● Visual References (start a pinterest board?)

Concept Art
Visual representations of ideas
● An early step in the design of a character (or location or vehicle etc)
● A lot of work will come from references here
● Very much the domain of the traditional sketcher/painter

Sculpting
Most likely digital sculpting
● Initial ideas going from concept art to 3D model
● Options for sculpting in clay and the 3D scanning
● More often sculpted and modelled digitally
○ This work will be done in a 3D modelling and/or 3D sculpting program
● Unlikely to be game ready at this point
○ Too many polygons to run efficiently
○ Only vertices, no other important information

Programmers working with artists
In the meantime, us, the programmers are also working
● We’ll establish a scale for the game world
● And most likely set up our source control (not always git when working
alongside artists)
● Artists will provide us with a sample object (like a cube)
● We’ll set up correct transforms for this and start building up graphics
engine capabilities

Optimisation and Texturing
Getting a model ready for use
● If a model has been sculpted, it might have a lot of extra polygons
● It will either be remodelled or optimised to remove vertices
● Then it must be UV mapped
● This is the process of adding texture coordinates to the vertices
○ Texture coords are usually called (u,v)
● Then once mapped, actually “painting” the textures
○ Creating the 2D images, usually in a digital painting program
○ This also means adding other maps which we haven’t learnt about yet in this course
○ Artists might refer to these as “materials”

Polygon Reduction Optimisation
Image credit: Wikipedia

Rigging and Animation
Skin and Bones
● Animation in games is usually done via an internal bone system
● Artists will create a skeleton
● And “rig” the mesh to the skeleton
● With a rigged skeleton, animations can be created
● Animations are dependent on game needs, so they might not all be planned in advance

What ends up in the game?
As programmers we receive:
● A 3d model (vertex and index buffers)
● with textures and other maps (materials)
● and a set of animations
We will then:
● Make sure these are imported and handled in our engine correctly
● Transform the model into its correct place in the world
● Write code to activate its animations at the right time

How many artists was that?
There are many specialisations in this pipeline
● Concept Artists
● Sculptors
● 3D Modellers
● Texture Artists
● Riggers
● Animators
● Depending on the project, these might all be different people!

Modelling

Creating 3D Models
A big collection of vertices
● Models are essentially a bunch of verts
● (also textures and other maps/materials)
● Picking numbers for vert coordinates could be a
very painstaking task
● So certain techniques are used to create multiple
verts
○ Box modelling
○ Digital Sculpting
○ 3D Scanning and Photogrammetry
Image credit: Stanford University

Box Modelling
Start with a box, add verts
● Start with some kind of primitive object (cube/cylinder are common)
● Add vertices in between
○ Usually take a quad and turn it into 4 quads
Image credit: Viegas
● Move vertices around to create rough shapes
● The more verts you add, the more detail you create
● Common technique used in Maya, 3DS Max, Blender
etc
Image credit:

Digital Sculpting
Treating a 3D model like a solid substance
● Initially an attempt to give traditional sculptors a way to create digital models
● Adding and subtracting “chunks” of the model and smoothing with tools replicating real materials
● The concept of polygons and vertices does not drive the process
○ but it will be a part of it eventually
● Used in Zbrush, Blender and others
Image credit: blenderartists.org user: 0rAngE

3D Scanning and Photogrammetry
Using technology to acquire surface information
● Laser scanners for detailed surface topography
● Cheaper and reasonably accurate results from
photogrammetry
● Builds up 3D model automatically using relative
viewpoints
● Usually very high complexity, would need
significant reduction in polygons for use
● Marc’s example: https://p3d.in/Ekkiv
Painting and Photogrammetry by

Break Time
The joys of creation
● Highly recommended to partake in art
● No limitations on what kind of art you want to do
● Something that takes you away from your “day job”
● Can be very valuable for stress relief and fulfilment
● Marc paints little toys in his spare time

Animation

What is animation?
A series of still images, an illusion of motion
● Oldest use of this is in Zoetropes (1800s or possibly 1st Century BC)
● The advent of film cameras and projectors brought the film industry to life (around 1895)
● We already understand the idea of frames and us drawing each frame as a separate still image
● But how do we decide how much our geometry should change between frames?
Image credit: Horner 1887
Image credit: 1887

Frame by Frame Animation
Doing it by hand
● The simplest way to understand
● Vertices are in a particular position in one frame
● They are in a new position in the next frame
● Hand drawn cel animation works in this way
Doing this in Graphics?
● While possible, it’s incredibly time consuming, considering the number of vertices
● There must be a way of bulk editing multiple verts
Image credit: Jan- ̈m, Helsinki, Finland

Vertices aren’t alone!
Animation by objects
● We could animate by changing transforms!
● Each object can have its transform “lerped” maybe along a curve
● We could animate by changing some transforms within a scene graph
● This way, we could have different objects move relative to each other
● You may remember this from Tutorial 4 . . .

Animation by objects
What are the downsides to this approach?
● Forced separation of objects based on movement
● An artist will have to separately model fingers, lower arms, upper arms,
shoulders etc.
● Models will start to look like deconstructed action figures
● Highly complex scene graphs and tiny separate pieces
● Computers can handle this, but can we?
● Also, how good is this method for say, an organic creature or cloth?

Skeletal Animation
An In-between solution
● What if we have ways of affecting sections of an object, but not the whole thing?
● Treat the mesh as the “skin” and build a skeleton inside the model
● The skeleton is a series of abstract positions that are linked together with a scene graph-like hierarchy of transforms
Images credit: Valve Developer Community

Details of Skeletal Animation
How do bones affect the mesh?
● Each vertex in the mesh is affected by some bone(s)
● We do this via a weighted list of bones in each vertex
● A simple rigid object might have a single bone and all verts are affected
100% by that bone
● A flexible are like the skin around an elbow will have partial weight from
the lower arm and partial weight from the upper arm
● When a bone moves, it will alter the mesh
● The higher the weight, the more the mesh will follow the bone movement

Rigging
Rigging involves building a logical skeleton
● For something like a human, this is going to look reasonably familiar
● But for more abstract models, it’s harder to predict
● Skeletons and bones don’t have to be “inside” the mesh, they just control
its movement and are hierarchically organised
● Each bone is intended to control some movement
● Vertices that are near that point of movement will be mapped to that
bone
● Vertices further away will have less connection to the bone, or won’t be
connected at all

Rigging
Different weights will allow bones to have more influence over different parts of a mesh

Animation
Animate the Skeleton
● If we use the object based animation we talked about earlier
● But this time with the transforms in a rigged skeleton
● Our model will follow that skeleton
● It will also morph and stretch where there are partial weights
● It also means an animator is moving say 20-30 bones, not 500+ vertices

Keyframe Animation
Do animators specify positions for every frame?
● We’ve reduced the number of vertices, but not frames
● Skeletons usually only have translation and rotation relative to other
bones
● Often animators will only set joint positions made up of rotation angles
● These poses can be used as “keyframes” and can be as little as one every
30-40 actual screen frames
● The frames in between can be determined by lerping the joint
orientations

Keyframing Images
Images credit: Learnopengl.com

In OpenGL
Animating in OpenGL
● Import a model with animations, bone and weights
● Transform verts to their correct positions relative to bones
● Animations will have keyframe information
● As well as timings: How long in real time in between each keyframe
● To play an animation, we interpolate bone positions between keyframes
depending on how long the animation has been running
● We transform vertices relative to wherever their bones currently are (and
what weighting they have to the bones)

What did we learn today?
The Art Pipeline
● Overview of the entire art pipeline for something like a character
● Detail on 3D Modelling
● Detail on Animation and Rigging