From a6d4ca7694e276789f26ef87bce9490f70b2d628 Mon Sep 17 00:00:00 2001 From: HarrievG Date: Fri, 10 Jun 2022 22:06:38 +0200 Subject: [PATCH] material name is now used as texture/idMaterial --- neo/renderer/Model_gltf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neo/renderer/Model_gltf.cpp b/neo/renderer/Model_gltf.cpp index 2377cdb1..4e50c175 100644 --- a/neo/renderer/Model_gltf.cpp +++ b/neo/renderer/Model_gltf.cpp @@ -19,6 +19,7 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive * gltfAccessor* accessor = _data->AccessorList( )[prim->indices]; gltfBufferView* bv = _data->BufferViewList( )[accessor->bufferView]; gltfData* data = bv->parent; + gltfMaterial* mat = _data->MaterialList()[prim->material]; gltfBuffer* buff = data->BufferList( )[bv->buffer]; uint idxDataSize = sizeof( uint ) * accessor->count; @@ -39,7 +40,7 @@ MapPolygonMesh* MapPolygonMesh::ConvertFromMeshGltf( const gltfMesh_Primitive * for( int i = 0; i < accessor->count; i += 3 ) { MapPolygon& polygon = mesh->polygons.Alloc(); - polygon.SetMaterial( "textures/enpro/enwall16" ); + polygon.SetMaterial( mat->name ); polygon.AddIndex( indices[i + 2] ); polygon.AddIndex( indices[i + 1] ); polygon.AddIndex( indices[i + 0] );