From d8225d0663c8eda410138c7ca086fa65912e07ae Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 29 Oct 2013 22:09:06 -0500 Subject: Add support for IQM int blend indices and float blend weights Integer blend indices are converted to bytes at load, ioq3 doesn't allow more than 128 joints. Heavily based on code by @zippers. --- src/renderergl1/tr_local.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/renderergl1/tr_local.h') diff --git a/src/renderergl1/tr_local.h b/src/renderergl1/tr_local.h index 96fa6445..59058eaf 100644 --- a/src/renderergl1/tr_local.h +++ b/src/renderergl1/tr_local.h @@ -619,10 +619,18 @@ typedef struct { float *normals; float *tangents; byte *blendIndexes; - byte *blendWeights; + union { + float *f; + byte *b; + } blendWeights; byte *colors; int *triangles; + // depending upon the exporter, blend indices and weights might be int/float + // as opposed to the recommended byte/byte, for example Noesis exports + // int/float whereas the official IQM tool exports byte/byte + byte blendWeightsType; // IQM_BYTE or IQM_FLOAT + int *jointParents; float *jointMats; float *poseMats; -- cgit