summaryrefslogtreecommitdiff
path: root/indra/newview/lltinygltfhelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltinygltfhelper.cpp')
-rw-r--r--indra/newview/lltinygltfhelper.cpp65
1 files changed, 0 insertions, 65 deletions
diff --git a/indra/newview/lltinygltfhelper.cpp b/indra/newview/lltinygltfhelper.cpp
index c3dc10c2a0..c80e87652a 100644
--- a/indra/newview/lltinygltfhelper.cpp
+++ b/indra/newview/lltinygltfhelper.cpp
@@ -122,71 +122,6 @@ void LLTinyGLTFHelper::initFetchedTextures(tinygltf::Material& material,
}
}
-void LLTinyGLTFHelper::setFromModel(LLGLTFMaterial* mat, tinygltf::Model& model, S32 mat_index)
-{
- if (model.materials.size() <= mat_index)
- {
- return;
- }
-
- tinygltf::Material& material_in = model.materials[mat_index];
-
- // get base color texture
- S32 tex_index = material_in.pbrMetallicRoughness.baseColorTexture.index;
- if (tex_index >= 0)
- {
- mat->mBaseColorId.set(model.images[tex_index].uri);
- }
- else
- {
- mat->mBaseColorId.setNull();
- }
-
- // get normal map
- tex_index = material_in.normalTexture.index;
- if (tex_index >= 0)
- {
- mat->mNormalId.set(model.images[tex_index].uri);
- }
- else
- {
- mat->mNormalId.setNull();
- }
-
- // get metallic-roughness texture
- tex_index = material_in.pbrMetallicRoughness.metallicRoughnessTexture.index;
- if (tex_index >= 0)
- {
- mat->mMetallicRoughnessId.set(model.images[tex_index].uri);
- }
- else
- {
- mat->mMetallicRoughnessId.setNull();
- }
-
- // get emissive texture
- tex_index = material_in.emissiveTexture.index;
- if (tex_index >= 0)
- {
- mat->mEmissiveId.set(model.images[tex_index].uri);
- }
- else
- {
- mat->mEmissiveId.setNull();
- }
-
- mat->setAlphaMode(material_in.alphaMode);
- mat->mAlphaCutoff = llclamp((F32)material_in.alphaCutoff, 0.f, 1.f);
-
- mat->mBaseColor= getColor(material_in.pbrMetallicRoughness.baseColorFactor);
- mat->mEmissiveColor = getColor(material_in.emissiveFactor);
-
- mat->mMetallicFactor = llclamp((F32)material_in.pbrMetallicRoughness.metallicFactor, 0.f, 1.f);
- mat->mRoughnessFactor = llclamp((F32)material_in.pbrMetallicRoughness.roughnessFactor, 0.f, 1.f);
-
- mat->mDoubleSided = material_in.doubleSided;
-}
-
LLColor4 LLTinyGLTFHelper::getColor(const std::vector<double>& in)
{
LLColor4 out;