question about vertex blend

question about vertex blend

Post by CC[FaNtAsY » Tue, 20 May 2003 01:27:24



Hi, ALL!
i'd like to know how can i get the final influencing matrix  after setting
the D3DRS_VertexBlend for the RenderState. I've checked the skinnedmesh
sample and the DX doc and it seems to be some weights used for blending,
each weight multiply one matrix as from D3D_WORLDMATRIX(i) and then sum them
up. but where can i find these weights? from the original vertecies data?
each vertex struct has a weights list? it would be time-consuming the
calculate them all to do some further effects....
thanks in advance. :)
 
 
 

question about vertex blend

Post by Rich [Microsoft Direct3D MV » Tue, 20 May 2003 01:31:58


[Please do not mail me a copy of your followup]



Quote:>i'd like to know how can i get the final influencing matrix  after setting
>the D3DRS_VertexBlend for the RenderState. I've checked the skinnedmesh
>sample and the DX doc and it seems to be some weights used for blending,
>[...]

Try looking at the VertexBlend sample, which computes the weights.
--
    "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
              <http://www.xmission.com/~legalize/book/>

 
 
 

question about vertex blend

Post by CC[FaNtAsY » Wed, 21 May 2003 10:45:21


Thanks. but i do think the methods in these two samples are different.
VertexBlend use D3DFVF_XYZB1 in FVF definition to set the blend weights,
while Skinnedmesh just load these values from the .x files, if i don't guess
wrong. i can see that matrixOffset in SkinWeights are loaded, but don't know
what data structure the weights hold(they exists in the .x file, for
example, tiny.x).
so, could anyone explain the mechanism in this sample plz? thank you!
Quote:

> Try looking at the VertexBlend sample, which computes the weights.
> --

 
 
 

question about vertex blend

Post by Rich [Microsoft Direct3D MV » Wed, 21 May 2003 12:44:06


[Please do not mail me a copy of your followup]

In tiny.x the skin weights are computed by the modelling software and
dumped into the X file in the FVFData template.  FVFData holds
whatever data isn't present in the standard Mesh related templates.
The data is a collection of DWORDs, n DWORDs per vertex, for the n
DWORDs of data not covered by the Mesh templates.  The DWORDs are
ordered according to the restrictions of an FVF vertex layout.
--
    "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
              <http://www.xmission.com/~legalize/book/>

 
 
 

question about vertex blend

Post by Rich [Microsoft Direct3D MV » Wed, 21 May 2003 12:48:11


[Please do not mail me a copy of your followup]

Woops, slight correction.  FVFData holds things like additional
texture coordinate sets, or texture coordinates that aren't 2D since
MeshTextureCoords only handles a single set of 2D texture coordinates.

The SkinWeights template holds the vertex blending information.  The
vertex indices are the indices of the vertices in the Mesh template
and the given weights are associated with those indices for that bone.

All of this information is cooked down into vertex blend weights based
on the methods in ID3DXSkinInfo (DX9) or ID3DXSkinMesh (DX8).  The X
file templates allow you to define an arbitrarily skinned mesh with an
arbitrary number of bones with each bone potentially influencing every
vertex in the mesh.

When it comes to rendering on a device using vertex blending or
indexed vertex blending, you have to operate within the restrictions
of the device, which is why ID3DXSkinInfo provides methods to convert
the skinning data into a blended mesh or an indexed blended mesh.
--
    "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
              <http://www.xmission.com/~legalize/book/>

 
 
 

question about vertex blend

Post by CC[FaNtAsY » Thu, 22 May 2003 02:55:16


thank you for your reply.
frankly speaking, it's still unclear to me how the sample program manages
these weights data after read your post.
the program set transforms of the bone matrix, set the render state of
VertexBlend, but where does it load the weights? i mean the code
itself.(what's the function, what's the data structure) is it transparent to
the programmer, well encapsulated in the ID3DXSkinMesh interface?
i know they are in the suitable template in the .x files, but what's the
relevant code section of it in skinnedmesh sample?
Quote:> [Please do not mail me a copy of your followup]

> Woops, slight correction.  FVFData holds things like additional
> texture coordinate sets, or texture coordinates that aren't 2D since
> MeshTextureCoords only handles a single set of 2D texture coordinates.

> The SkinWeights template holds the vertex blending information.  The
> vertex indices are the indices of the vertices in the Mesh template
> and the given weights are associated with those indices for that bone.

> All of this information is cooked down into vertex blend weights based
> on the methods in ID3DXSkinInfo (DX9) or ID3DXSkinMesh (DX8).  The X
> file templates allow you to define an arbitrarily skinned mesh with an
> arbitrary number of bones with each bone potentially influencing every
> vertex in the mesh.

> When it comes to rendering on a device using vertex blending or
> indexed vertex blending, you have to operate within the restrictions
> of the device, which is why ID3DXSkinInfo provides methods to convert
> the skinning data into a blended mesh or an indexed blended mesh.
> --
>     "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
>       <http://www.xmission.com/~legalize/book/>

 
 
 

question about vertex blend

Post by Rich [Microsoft Direct3D MV » Thu, 22 May 2003 06:50:36


[Please do not mail me a copy of your followup]



Quote:>[...] but where does it load the weights? [...] is it transparent to
>the programmer, well encapsulated in the ID3DXSkinMesh interface?

Yes.  D3DXLoadSkinMesh loads the mesh into the returned ID3DXMesh
object and the skinning information (bones, weights, etc.) into the
ID3DXSkinInfo object.

CMyD3DApplication::GenerateSkinnedMesh in the sample takes the
ID3DXSkinInfo and the ID3DXMesh object returned by the
D3DXLoadMeshHierarchyFromX function and creates a mesh that includes
blend weights for rendering, based on the rendering method selected in
the sample.
--
    "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
              <http://www.xmission.com/~legalize/book/>

 
 
 

1. Xform vertexes of a primitive by different matrixes / VERTEX BLENDING

I Use Bezier-Surfaces for a high detailed human
character. For natural looking animation i have to
transform the vertexes of one surf by different
matrixes. This breaks OpenGL transformation pipeline and so it can't be done
by T&L-hardware,
which will be a problem in the near future!

DX7 seems to have a solution called "vertex blending" (If any one have
information about, please tell me).
Will there be a extension to OpenGL, and
how will it work ???

2. Databases of Software Products, Companies, Events

3. question: vertex arrays under win98 + vertices to polygons

4. tutorial for animated walking ?

5. Per vertex alpha blending?

6. i860 graphics performance

7. General Q: What is vertex blend?

8. HELP. Collapsed mesh into boolean operand... need an editable mesh

9. What is vertex blending used for?

10. skeletal animation with vertex blending

11. Index vertex blending

12. RESOURCE: rt_Skin vertex blending visualization sample

13. indexed vertex blending