better ps2 swizzling code

This commit is contained in:
aap
2018-01-04 22:14:50 +01:00
parent e9d53fd834
commit c60cecbd02
2 changed files with 88 additions and 50 deletions

View File

@@ -654,6 +654,13 @@ skinUninstanceCB(Geometry *geo)
case 4: // weights
for(int32 i = 0; i < geo->numVertices; i++){
unpackattrib(weights, p, a);
float sum = weights[0] + weights[1] + weights[2] + weights[3];
if(sum){
weights[0] /= sum;
weights[1] /= sum;
weights[2] /= sum;
weights[3] /= sum;
}
weights += 4;
p += a->stride;
}