The Industry's Foundation for High Performance Graphics

1. how i can do vertex blending without shaders?

most specifically, indexed vertex blending with number of matrices and influences unlimited , as blender software,

Is efficient transform the vertices one by one?,
How I can optimize it?

2. Re: how i can do vertex blending without shaders?

There is no other way than transforming vertex by vertex. That's the reason why it is done usually with vertex shaders.

Maybe you can optimize a CPU based implementation if you reuse the weighted matrices for the vertices that have the same weights but it is very unlikely that it will improve the performance of skinning by an observable amount.

3. Re: how i can do vertex blending without shaders?

Some pre-shader hardware supports extensions to accelerate vertex blending, such as:
http://oss.sgi.com/projects/ogl-samp...rtex_blend.txt
http://www.khronos.org/registry/gles...ix_palette.txt

If your platform has an extension like that, try it. Otherwise, software transform.

4. Re: how i can do vertex blending without shaders?

Code :
```for (int i=0; i < fVertexCount; i++)
{
//	determine transform
Vector3 pos(0,0,0);
Vector3 nor(0,0,0);
for (int bone = 0; bone < MAX_BONES_PER_VERTEX; bone++)
{
Matrix4 &amp;m44 = mBones[(int)src->mBoneIndices[bone]]->mTransformMatrix;
Vector3 offset = m44.Transform((Vector3&amp;)src->mPosition);
offset *= src->mWeights[bone];
pos += offset;

// update normals
Matrix3 m33 = Matrix3(m44[0].Column(0), m44[1].Column(1), m44[2].Column[2]);
nor += m33 * src->mNormal * src->mWeights[bone];
}

//  update geometry
float *p = dst->mPosition;
*p++ = pos.x;
*p++ = pos.y;
*p++ = pos.z;
// update normals
float *n = dst->mNormals;
*n++ = nor.x;
*n++ = nor.y;
*n++ = nor.z;

src++;
dst++;
}```

5. Re: how i can do vertex blending without shaders?

thank's, I'll do some experiments to determinate the processing time, i know the best way is the vertex shaders, but not all video cards allow this, and vertex shaders involve limitations at time to define matrices and influences.

by the by, every vertex have a influences number, so i have not to transform vertices 4 times every time. in this regard, it is more efficient than shaders

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•