Introduce gltfio-lite.

This is 466 KB insted of the usual 850 KB. It assumes that users do not
need spec-gloss, non-lit, or a special transparency mode.

(uncompressed SO size on arm64)

We can add a new maven project for this next week.
This commit is contained in:
Philip Rideout
2020-02-14 15:15:25 -08:00
parent a9bbc6d3c4
commit b9c857130a
4 changed files with 68 additions and 15 deletions

View File

@@ -362,6 +362,11 @@ void FAssetLoader::createRenderable(const cgltf_node* node, Entity entity) {
UvMap uvmap {};
bool hasVertexColor = primitiveHasVertexColor(inputPrim);
MaterialInstance* mi = createMaterialInstance(inputPrim->material, &uvmap, hasVertexColor);
if (!mi) {
mError = true;
continue;
}
mResult->mDependencyGraph.addEdge(entity, mi);
builder.material(index, mi);
@@ -868,6 +873,11 @@ MaterialInstance* FAssetLoader::createMaterialInstance(const cgltf_material* inp
// This not only creates a material instance, it modifies the material key according to our
// rendering constraints. For example, Filament only supports 2 sets of texture coordinates.
MaterialInstance* mi = mMaterials->createMaterialInstance(&matkey, uvmap, inputMat->name);
if (!mi) {
slog.e << "No material with the specified requirements exists." << io::endl;
return nullptr;
}
mResult->mMaterialInstances.push_back(mi);
if (inputMat->alpha_mode == cgltf_alpha_mode_mask) {