how to implement a Vertex Blending in cpu?

Started by
12 comments, last by derek7 18 years, 11 months ago
in a book,it use vertex shader to do it. but many game do not use vertex shader to do skinned mesh animation.because my graphic card not support vertex shader and pixel shader, but can run game that have skinned mesh animation. so how to do skinned mesh animation game in cpu? I need setTransform for every vertex? it is not effective admittedly. so what solution is introduced?
Advertisement
Have a look to the SkinnedMesh - Sample in the directx SDK !
*Los Brutalos*(Sorry for my brutal english ;)
if I am right ,it use GPU to do .
Quote:Original post by derek7
if I am right ,it use GPU to do .

I think you can switch between how it performs the skinning.

You could look into vertex weighting. Most devices these days support 2-3 weights per vertex; and a reasonably sized matrix "pool" (D3DTS_WORLD1...D3DRS_WORLD255 iirc). It's not quite software skinning, but it's reasonably close and should have some degree of support on older non-programmable hardware.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

matrix pool??how to use it?

I do skinmesh in this way:

copy vertex to system memory,and then do matrix multiplication with D3DX function/it maybe operate on cpu
and then I rewirte/update vertex data into video memory I mean dynamic buffer.
Quote:Original post by derek7
in a book,it use vertex shader to do it.

but many game do not use vertex shader to do skinned mesh animation.because my graphic card not support vertex shader and pixel shader, but can run game that have skinned mesh animation.


Even if your graphics card doesn't support vertex shaders, you *can* still use vertex shaders if it makes life easier for you.

Software vertex processing will execute vertex shader code using the CPU. The Direct3D PSGP (Processor Specific Geometry Pipeline) is also very well optimized to take advantage of CPU extensions such as 3DNow! and SSE.

You can enable software vertex processing by passing the D3DCREATE_SOFTWARE_VERTEXPROCESSING and D3DUSAGE_SOFTWAREPROCESSING flags to the relevent D3D calls.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I find a method to do the job.

ID3DXSkinInfo::UpdateSkinnedMesh

it take a hierarchy bone/frame and a meshcontainer to do this job.

but I want to know it used software vertex shader to do?

or just use matrix multiplication operation on cpu provided by D3DX lib to do the job?
ID3DXSkinInfo::UpdateSkinnedMesh uses matrix multiplication provided by D3DX; it doesn't use software vertex shaders.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

there are a few skinned mesh method I just find
1.Fixed function skinning and Fixed non-indexed skinning
2.software skinning
3.asm shader skinning
4.hlsl shader skinning

what is different?

but I have a question .
my graphic card not support vertex shader ,but it support
D3DCREATE_HARDWARE_VERTEXPROCESSING,so I mean D3DCREATE_HARDWARE_VERTEXPROCESSING != vertex shader? Am I right? and so how to do software skinning? just pass D3DCREATE_SOFTWARE_VERTEXPROCESSING and D3DUSAGE_SOFTWAREPROCESSING , work?
extra a question I find indexed skinning is slower than non-indexed skinning in my computer.
so is it in gear? I mean indexed data just save memory and no save cpu?

This topic is closed to new replies.

Advertisement