Graphics Reference
In-Depth Information
Debugging incorrect vertex placement is sometimes easier by
changing the IA primitive topology to a point list and changing
the background color of the scene to white or black (depending
on the expected vertex color).
There's moreā€¦
Performing vertex skinning results in a constant per-vertex performance hit. Therefore, it is
desirable to have as few vertices as possible in large scenes that have multiple armatures.
A common technique of getting around the limitations of a lower maximum bone count on
older hardware was implementing bone partitioning, whereby the mesh is broken up into
smaller parts that share the same subset of bones. Each part is then drawn separately.
See also
F The Loading bones in the mesh renderer recipe provides an implementation for
loading the bones from a CMO mesh within a mesh renderer
Loading bones in the mesh renderer
In this recipe, we will modify the mesh renderer to support transforming vertices based on
the underlying bone structure. This necessitates the loading of the armature from the loaded
mesh. This is required in order to implement mesh animations.
The Visual Studio graphics content pipeline includes bones and animations from Autodesk
FBX models in the resulting CMO file. Bones are stored in the file as an array of bones,
consisting of a parent index and the inverse bind pose, the bind pose, and bone local
transform matrices. The root bone in a hierarchy of bones has a parent index of -1 .
Getting ready
We will be using a new Autodesk FBX model along with a texture file that can be found
in the downloaded content. The precompiled mesh file and texture are also included.
In this example, we will need the MeshRenderer class and the graphics content pipeline's
build targets in place that were created in the Loading a static mesh from a file recipe in
Chapter 3 , Rendering Meshes . We will also require the vertex shader from the previous
recipe, Preparing the vertex shader and buffers for vertex skinning .
F The completed project for this recipe ( Ch04_01VertexSkinning ) includes a new
axis-grid renderer for the x and z axes, which can be optionally included.
 
Search WWH ::




Custom Search