Add support mjcf emissive layer materials

Mujoco supports emission as a constant coefficient, and emissive, an rgb texture. This cl supports the rgb emissive texture for usd.

PiperOrigin-RevId: 775236677
Change-Id: I0e2ce1d9f68d79b6e9d2c28eecab22b2692f061c
This commit is contained in:
Google DeepMind
2025-06-24 08:05:08 -07:00
committed by Copybara-Service
parent a0614fff1f
commit 78df2ae7fa
4 changed files with 33 additions and 0 deletions
@@ -192,6 +192,16 @@ TEST_F(MjcfSdfFileFormatPluginTest, TestMaterials) {
stage, "/mesh_test/Materials/material_layered/orm_packed.inputs:file",
pxr::SdfAssetPath("textures/orm.png"));
EXPECT_PRIM_VALID(stage, "/mesh_test/Materials/material_layered/emissive");
ExpectAttributeHasConnection(
stage,
"/mesh_test/Materials/material_layered/"
"PreviewSurface.inputs:emissiveColor",
"/mesh_test/Materials/material_layered/emissive.outputs:rgb");
ExpectAttributeEqual(
stage, "/mesh_test/Materials/material_layered/emissive.inputs:file",
pxr::SdfAssetPath("textures/emissive.png"));
EXPECT_PRIM_VALID(stage, "/mesh_test/Materials/material_metallic");
EXPECT_PRIM_VALID(stage,
"/mesh_test/Materials/material_metallic/PreviewSurface");
@@ -3,6 +3,7 @@
<texture name="diffuse_tex" file="textures/cube.png" type="2d" />
<texture name="normal_tex" file="textures/normal.png" type="2d" />
<texture name="orm_tex" file="textures/orm.png" type="2d" />
<texture name="emissive_tex" file="textures/emissive.png" type="2d" />
<material name="material_red" rgba="0.8 0 0 1" />
<material name="material_texture" texture="diffuse_tex" />
<material name="material_metallic" rgba="0.8 0 0 1" metallic="0.6"/>
@@ -10,6 +11,7 @@
<layer texture="diffuse_tex" role="rgb"/>
<layer texture="normal_tex" role="normal"/>
<layer texture="orm_tex" role="orm"/>
<layer texture="emissive_tex" role="emissive"/>
</material>
2d texture="diffuse" normal="normal" />
<mesh name="tetrahedron" vertex="0 0 0 1 0 0 0 1 0 0 0 1"/>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB