From 5fa75a6d4b03c676112ca04cf5ff3f3ccd2f0fee Mon Sep 17 00:00:00 2001 From: rodri Date: Tue, 28 May 2024 16:56:31 +0000 Subject: add a normal map property to Material. --- scene.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scene.c') 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); } -- cgit v1.2.3