Docsity

Rendering Review - Computer Animation - Slides | CSE 169, Study notes of Fundamentals of Design

Partial preview of the text

Download Rendering Review - Computer Animation - Slides | CSE 169 and more Study notes Fundamentals of Design in PDF only on Docsity!

Skin

CSE169: Computer Animation

Instructor: Steve Rotenberg

UCSD, Winter 2008

Rendering Review

Lighting^ „

We can compute the interaction of light withsurfaces to achieve realistic shading

„

For lighting computations, we usually require aposition on the surface and the normal

„

GL does some relatively simple

local

illumination

computations

„

For higher quality images, we can compute global

illumination, where complete light

interaction is computed within an environment toachieve effects like shadows, reflections,caustics, and diffuse bounced light

Gouraud & Phong Shading^ „

We can use triangles to give the appearance of asmooth surface by faking the normals a little

„

Gouraud shading is a technique where we compute thelighting at each vertex and interpolate the resulting coloracross the triangle

„

Phong shading is more expensive and interpolates thenormal across the triangle and recomputes the lightingfor every pixel

Materials^ „

In high quality rendering, we use a functioncalled a BRDF (bidirectional reflectancedistribution function) to represent the scatteringof light at the surface:

f

(r^

θ

,i

φ

,i

θ

,r

φ

,r

λ

)

„

The BRDF is a 5 dimensional function of theincoming light direction (2 dimensions), theoutgoing direction (2 dimensions), and thewavelength

Translucency^ „

Skin is a translucent material. If we want torender skin realistically, we need to account forsubsurface light scattering.

„

We can extend the BRDF to a BSSRDF byadding two more dimensions representing thetranslation in surface coordinates. This way, wecan account for light that enters the surface atone location and leaves at another.

„

Learn more about these in CSE168!

Smooth Skin Algorithm

Weighted Blending & Averaging^ „

Weighted sum:

„

Weighted average:

„

Convex average:

0

∑

∑

=

=^ i

i

i i

i

i

w w

x

w

x

Simple Skin^ „

A simple improvement for low-medium qualitycharacters is to rigidly bind a skin to theskeleton. This means that every vertex of thecontinuous skin mesh is attached to a joint.

„

In this method, as with rigid parts, every vertexis transformed exactly once and shouldtherefore have similar performance to renderingwith rigid parts.

v

W

v

Smooth Skin^ „

With the smooth skin algorithm, a vertex can beattached to more than one joint with adjustableweights that control how much each joint affectsit

„

Verts rarely need to be attached to more thanthree joints

„

Each vertex is transformed a few times and theresults are blended

„

The smooth skin algorithm has many othernames: blended skin, skeletal subspacedeformation (SSD), multi-matrix skin, matrixpalette skinning…

Binding Matrices^ „

With rigid parts or simple skin,

v

can be defined local to

the joint that transforms it

„

With smooth skin, several joints transform a vertex, but itcan’t be defined local to all of them

„

Instead, we must first transform it to be local to the jointthat will then transform it to the world

„

To do this, we use a binding matrix

B

for each joint that

defines where the joint was when the skin was attachedand premultiply its inverse with the world matrix:

1 −

i

i

i^

B

W

M

Normals^ „

To compute shading, we need totransform the normals to world space also

„

Because the normal is a direction vector,we don’t want it to get the translation fromthe matrix, so we only need to multiply thenormal by the upper 3x3 portion of thematrix

„

For a normal bound to only one joint:

n

W

n

Algorithm OverviewSkin::Update()

(view independent processing)

„

Compute skinning matrix for each joint:

M=W

· B

-

(you can

precompute and store

B

instead of

B

)

„

Loop through vertices and compute blended position & normal

Skin::Draw()

(view dependent processing)

„

Set matrix state to Identity (world)

„

Loop through triangles and draw using world space positions &normals

Questions:-^

Why not deal with

B

in Skeleton::Update()?

-^

Why not just transform vertices within Skin::Draw()?

Rig Data Flow^ „

Input DOFs

„

Rigging system(skeleton, skin…)

„

Output renderable mesh(vertices, normals…)

[

] N

2

1

n

v

Rig