Fix Mesh attribute normalization;

Normalize i8 and u8 attribute by default.

Forward attribute normalization from glTF accessors.
This commit is contained in:
bjorn 2019-04-13 16:08:58 -07:00
parent ed92c4e6db
commit 9d90e83657
2 changed files with 4 additions and 2 deletions

View File

@ -1220,7 +1220,8 @@ static int l_lovrGraphicsNewMesh(lua_State* L) {
.offset = attributes[i].offset,
.stride = stride,
.type = attributes[i].type,
.components = attributes[i].components
.components = attributes[i].components,
.normalized = attributes[i].type == I8 || attributes[i].type == U8
});
}

View File

@ -108,7 +108,8 @@ Model* lovrModelInit(Model* model, ModelData* data) {
.stride = data->buffers[attribute->buffer].stride,
.type = attribute->type,
.components = attribute->components,
.integer = j == ATTR_BONES
.integer = j == ATTR_BONES,
.normalized = attribute->normalized
});
if (!setDrawRange && !primitive->indices) {