I’m currently trying to get matrix palette skinning working in my application.
Using the address register either causes my program to return an error when uploading the program string or my framerate to drop from ~100fps to ~2fps.
Just to get things going I had the following code transforming everything by an identity matrix (this is not the full program just a fragment).
PARAM bones = { program.local[0…3] };
TEMP bonepos;
TEMP skinnedpos;ADDRESS addr;
Transform vertices by first bone matrix
ARL addr.x, boneindex.x;
DP4 bonepos.x, bones[0], position;
DP4 bonepos.y, bones[1], position;
DP4 bonepos.z, bones[2], position;
MUL skinnedpos, weight.x, bonepos;
Adding in a single use of address register indirection drops the framerate from 100fps to 2fps
PARAM bones = { program.local[0…3] };
TEMP bonepos;
TEMP skinnedpos;ADDRESS addr;
Transform vertices by first bone matrix
ARL addr.x, boneindex.x;
DP4 bonepos.x, bones[addr.x], position;
DP4 bonepos.y, bones[1], position;
DP4 bonepos.z, bones[2], position;
MUL skinnedpos, weight.x, bonepos;
Is there a ‘proper’ way to do things that won’t drop me down to a software path that i’m not aware of?
I’ve also noticed the following changes will cause the program to return errors when trying to load.
Changing the PARAM of bones from { program.local[0…3] } to anything not starting with a 0 (like program.local[16…18]) when using the address register.
Trying to inline program.local as in DP4 bonepos.x, program.local[addr], position;
Additionally, using too large a range in an ATTRIB will cut my framerate by about 1/3 even without using address register indirect. ie: ATTRIB bones[] = { program.local[0…47] };
Driver bugs? My not using the commonly accepted syntax? Gremlins? Any insight would be appreciated.
[This message has been edited by Pop N Fresh (edited 09-23-2003).]