Merge pull request #3387 from bd-pmorais:pmorais/renderer-live-mat-texid

PiperOrigin-RevId: 949427127
Change-Id: I607af41aefdefd6d22602889e6982d64df8b380b
This commit is contained in:
Copybara-Service
2026-07-17 01:23:40 -07:00
13 changed files with 98 additions and 15 deletions
+8
View File
@@ -241,6 +241,10 @@ static void setMaterial(const mjModel* m, mjvGeom* geom, int matid, const float*
// set texture
if (flags[mjVIS_TEXTURE] && matid >= 0) {
geom->matid = matid;
geom->texid = m->mat_texid[matid*mjNTEXROLE + mjTEXROLE_RGB];
geom->texuniform = m->mat_texuniform[matid];
geom->texrepeat[0] = m->mat_texrepeat[2*matid];
geom->texrepeat[1] = m->mat_texrepeat[2*matid+1];
}
// scale alpha for dynamic geoms only
@@ -379,6 +383,10 @@ void mjv_initGeom(mjvGeom* geom, int type, const mjtNum* size,
// set defaults that cannot be assigned via this function
geom->dataid = -1;
geom->matid = -1;
geom->texid = -1;
geom->texuniform = 0;
geom->texrepeat[0] = 0;
geom->texrepeat[1] = 0;
geom->texcoord = 0;
geom->emission = 0;
geom->specular = 0.5;