diff options
-rw-r--r-- | graphics.h | 1 | ||||
-rw-r--r-- | scene.c | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -108,6 +108,7 @@ struct Material Color specular; double shininess; Memimage *diffusemap; + Memimage *normalmap; }; struct Primitive @@ -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); } |