summaryrefslogtreecommitdiff
path: root/src/renderergl1/tr_local.h
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-10-29 22:09:06 -0500
committerTim Angus <tim@ngus.net>2014-06-17 17:43:35 +0100
commitd8225d0663c8eda410138c7ca086fa65912e07ae (patch)
tree79db0327d1ecc0a2c45f7f98d061249d611b2c57 /src/renderergl1/tr_local.h
parent16a2c5bed3771b7aedceeef18f15819b7b162c6b (diff)
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.
Diffstat (limited to 'src/renderergl1/tr_local.h')
-rw-r--r--src/renderergl1/tr_local.h10
1 files changed, 9 insertions, 1 deletions
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;