Merge pull request #1916 from LoicFr/master

Add vertex color support to glTF2 export
pull/1917/head
Kim Kulling 2018-04-26 13:37:30 +02:00 committed by GitHub
commit 90b4b6a18d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -732,6 +732,14 @@ void glTF2Exporter::ExportMeshes()
}
}
/*************** Vertex colors ****************/
for (unsigned int indexColorChannel = 0; indexColorChannel < aim->GetNumColorChannels(); ++indexColorChannel)
{
Ref<Accessor> c = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mColors[indexColorChannel], AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT, false);
if (c)
p.attributes.color.push_back(c);
}
/*************** Vertices indices ****************/
if (aim->mNumFaces > 0) {
std::vector<IndicesType> indices;