summaryrefslogtreecommitdiff
path: root/scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'scene.c')
-rw-r--r--scene.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/scene.c b/scene.c
index 15d3cc0..c9c8d5c 100644
--- a/scene.c
+++ b/scene.c
@@ -180,6 +180,13 @@ loadobjmodel(Model *m, OBJ *obj)
mtl->diffusemap->data->ref++;
}
+ if(objmtl->norm != nil){
+ mtl->normalmap = allocmemimaged(objmtl->norm->r, objmtl->norm->chan, objmtl->norm->data);
+ if(mtl->normalmap == nil)
+ sysfatal("allocmemimaged: %r");
+ mtl->normalmap->data->ref++;
+ }
+
addmtlmap(&mtlmap, objmtl, m->nmaterials-1);
}