Set textures before assigning a material.

PiperOrigin-RevId: 830899288
Change-Id: I42029157e7be006d4dc18d0c84e27bf908af6f47
This commit is contained in:
Haroon Qureshi
2025-11-11 07:09:18 -08:00
committed by Copybara-Service
parent 22c0b68903
commit aa7cf15cc4
@@ -300,6 +300,7 @@ void Drawable::UpdateMaterial(const mjvGeom& geom) {
textures.metallic = object_mgr->GetTexture(geom.matid, mjTEXROLE_METALLIC);
textures.roughness = object_mgr->GetTexture(geom.matid, mjTEXROLE_ROUGHNESS);
textures.occlusion = object_mgr->GetTexture(geom.matid, mjTEXROLE_OCCLUSION);
material_.UpdateTextures(textures);
}
if (geom.type == mjGEOM_LINE || geom.type == mjGEOM_LINEBOX) {
@@ -356,10 +357,6 @@ void Drawable::UpdateMaterial(const mjvGeom& geom) {
}
}
if (geom.matid >= 0) {
material_.UpdateTextures(textures);
}
Material::Params params;
params.color = ReadFloat4(geom.rgba);
params.emissive = geom.emission;