mirror of https://github.com/bjornbytes/lovr.git
Animator renormalizes quantized weights;
It would be nice to do this in the importer, but it was 50+ lines and was really tricky to write without reading from uncached GPU-mapped memory. Instead, it's 1 line here. I hope zero-weight vertices aren't a thing?
This commit is contained in:
parent
ef87ec8cba
commit
ee3cc30851
|
@ -39,6 +39,9 @@ void lovrmain() {
|
|||
uint i3 = (indices >> 24) & 0xff;
|
||||
vec4 weights = unpackUnorm4x8(skin[vertexIndex].weights);
|
||||
|
||||
// Model loader does not currently renormalize weights post-quantization
|
||||
weights /= weights[0] + weights[1] + weights[2] + weights[3];
|
||||
|
||||
mat4 matrix = mat4(0);
|
||||
matrix += joints[i0] * weights[0];
|
||||
matrix += joints[i1] * weights[1];
|
||||
|
|
Loading…
Reference in New Issue