O'Reilly logo

Character Animation with Direct3D® by Carl Granberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Morphing Animation on the GPU

So far, all the morphing has been done in software, which, as you can imagine, can be pretty slow (especially for large meshes with many morph targets). Instead, here’s how you can do the morphing animation in the GPU. The problem with performing the morphing animation in hardware lies in the fact that the vertex shader operates on one vertex at a time. You have to upload more than one position element per vertex (one position for the base mesh, and one for each active morph target). The same applies to vertex normals (and, if necessary, UV coordinates and other vertex elements you want to blend between).

So far the format of a vertex has been defined using the old flexible vertex format (FVF). A typical vertex may ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required