mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 20:10:29 +02:00
Remove unnecessary hasTexcoordTransform
This commit is contained in:
parent
7b74561b27
commit
9cb5ed888a
1 changed files with 3 additions and 5 deletions
|
@ -177,7 +177,6 @@ std::pair<std::string, std::shared_ptr<NetworkMaterial>> NetworkMaterialResource
|
||||||
material->setModel(modelString);
|
material->setModel(modelString);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<bool, graphics::Material::NUM_TEXCOORD_TRANSFORMS> hasTexcoordTransform;
|
|
||||||
std::array<glm::mat4, graphics::Material::NUM_TEXCOORD_TRANSFORMS> texcoordTransforms;
|
std::array<glm::mat4, graphics::Material::NUM_TEXCOORD_TRANSFORMS> texcoordTransforms;
|
||||||
|
|
||||||
if (modelString == HIFI_PBR) {
|
if (modelString == HIFI_PBR) {
|
||||||
|
@ -378,7 +377,6 @@ std::pair<std::string, std::shared_ptr<NetworkMaterial>> NetworkMaterialResource
|
||||||
} else if (value.isObject()) {
|
} else if (value.isObject()) {
|
||||||
auto valueVariant = value.toVariant();
|
auto valueVariant = value.toVariant();
|
||||||
glm::mat4 transform = mat4FromVariant(valueVariant);
|
glm::mat4 transform = mat4FromVariant(valueVariant);
|
||||||
hasTexcoordTransform[0] = true;
|
|
||||||
texcoordTransforms[0] = transform;
|
texcoordTransforms[0] = transform;
|
||||||
}
|
}
|
||||||
} else if (key == "texCoordTransform1") {
|
} else if (key == "texCoordTransform1") {
|
||||||
|
@ -391,7 +389,6 @@ std::pair<std::string, std::shared_ptr<NetworkMaterial>> NetworkMaterialResource
|
||||||
} else if (value.isObject()) {
|
} else if (value.isObject()) {
|
||||||
auto valueVariant = value.toVariant();
|
auto valueVariant = value.toVariant();
|
||||||
glm::mat4 transform = mat4FromVariant(valueVariant);
|
glm::mat4 transform = mat4FromVariant(valueVariant);
|
||||||
hasTexcoordTransform[1] = true;
|
|
||||||
texcoordTransforms[1] = transform;
|
texcoordTransforms[1] = transform;
|
||||||
}
|
}
|
||||||
} else if (key == "lightmapParams") {
|
} else if (key == "lightmapParams") {
|
||||||
|
@ -423,8 +420,9 @@ std::pair<std::string, std::shared_ptr<NetworkMaterial>> NetworkMaterialResource
|
||||||
|
|
||||||
// Do this after the texture maps are defined, so it overrides the default transforms
|
// Do this after the texture maps are defined, so it overrides the default transforms
|
||||||
for (int i = 0; i < graphics::Material::NUM_TEXCOORD_TRANSFORMS; i++) {
|
for (int i = 0; i < graphics::Material::NUM_TEXCOORD_TRANSFORMS; i++) {
|
||||||
if (hasTexcoordTransform[i]) {
|
mat4 newTransform = texcoordTransforms[i];
|
||||||
material->setTexCoordTransform(i, texcoordTransforms[i]);
|
if (newTransform != mat4() || newTransform != material->getTexCoordTransform(i)) {
|
||||||
|
material->setTexCoordTransform(i, newTransform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue