Particle Effects

Download Report

Transcript Particle Effects

Character Customization

Need millions of unique individuals
But, artists can only create dozens

How to solve?








Texture swapping
Tinting
Mesh splicing
Mesh morphing
Accessory polygons
Linear scaling
Bone scaling
Texture Swapping


This is much cheaper than creating a new model
Can segment model, swap each piece separately
Character Tinting

Slice character up into sections
Colorize each section with vertex colors

Results on next slide...

Character Tinting
original
texture
tinted with
GL_MODULATE
tinted with
photoshop levels
dialog box
Tinting with “Levels”
The Photoshop “levels” dialog:
Each channel (R,G,B) has
Scale, Offset, Power
Gives broad range of results
90% of my shaders
are implementations of
photoshop effects
Trivially implemented in pixel shader
Just offset without scale and power ok
Tinting with Per-Pixel Alpha
Character Tinting
original
texture
tinted with
photoshop levels
dialog box
tinted with
GL_DECAL and a
per-pixel alpha
Mesh Splicing
Mesh Splicing
Vertices have to line up perfectly – easy
They have to have same vertex weights - hard
This is a problem
(and your artist isn’t going to solve it)
Answer: don’t model it separately.
Model it as one giant hydra-like object.
Make sure seam vertices are shared.
Mesh Morphing
I downloaded the normal head off the internet
I made the witch and demon heads by moving vertices
Mesh Morphing
download “makehuman”
// assume three global vertex arrays: witchpos, normalpos, demonpos
void makehead(float witchfactor, float demonfactor)
{
for (int i=0; i<NUMVERTICES; i++) {
output[i] = normalpos[i];
output[i] += witchfactor * (witchpos[i] – normalpos[i]);
output[i] += demonfactor * (demonpos[i] – normalpos[i]);
}
}
Morphing vs Splicing

Important advantage of morphing:

With splicing, cannot reshape the boundaries
Cannot reshape waist (no fat characters)
 Cannot reshape any other boundaries either.


No such limitations with morphing.
Morphing vs Splicing II

Does artist have to do “weird stuff”?

Splicing:



Make several meshes (easy)
Make edges line up (easy)
Maintain invariant that edge vertex weights are exactly equal.



Artist must use numeric vertex weights (very inconvenient)
Or, artist must use a “shared edge” (clumsy, counterintuitive)
Morphing:




Make a mesh (easy)
Insert extra vertices in interesting areas (easy)
Clone the mesh (easy)
Now tweak the clone without adding vertices (easy)
Accessory
Polygons
There are some things that morphing
can’t do well. See image:
For this, mesh splicing is better.
Mesh splicing is easy when it’s not a
choice of multiple meshes, only
“mesh” or “no mesh.”
Morphing vs Splicing II

Does artist have to do “weird stuff”?

Splicing:



Make several meshes (easy)
Make edges line up (easy)
Maintain invariant that edge vertex weights are exactly equal.



Artist must use numeric vertex weights (very inconvenient)
Or, artist must use a “shared edge” (clumsy, counterintuitive)
Morphing:




Make a mesh (easy)
Insert extra vertices in interesting areas (easy)
Clone the mesh (easy)
Now tweak the clone without adding vertices (easy)
Using glScale

If scale is uniform:


If scale is nonuniform:


Makes character look bigger, not taller.
Doesn’t work. See image.
Need something
smarter – bone
scaling.
Bone-based Scaling


Normally, you think about rotating bones.
But bones are represented as matrices –




meaning, you can translate and scale as well.
and, you can do nonuniform scaling.
sims modders have discovered that it’s possible to use
nonuniform scaling to create fat sims:
That’s a lot of variety
for just tweaking a few
scaling factors. No
extra memory usage!!!
City of Heroes