Having trouble with USD material not showing correct color

I exported some usd assets from IsaacSim but they are not showing up correctly on my Apple Vision Pro.

Even though the mesh looks to be the correct color in Finder and I can see the Diffuse Color looks correct, the object is still just gray. It should be green!

Hello @ericD_TRI, thank you for your question!

It's hard to diagnose the exact issue from your screenshot. Could you share more about how you configured the materials in Reality Composer Pro? You say the diffuse color on your material looks correct, so can you confirm that the material is applied to the Entity in the material bindings section for that Entity in the inspector?

Also, how did you export the asset? Is the original asset also green, and is that what you are previewing? Or are you previewing the scene you modified in Reality Composer Pro?

I think if you share a few more full-screen screen captures of RCP that would help us get to the bottom of the issue here.

Alternatively, you can submit a bug report using Feedback Assistant. You can then share the ticket number here and I'll be able to take a look on my end. You can even share your entire project with us confidentially in the feedback ticket, which would certainly be enough context to figure out what is going wrong.

Let me know if you have any other questions!

This is the usda file for the asset. There is a diffuse color listed in the Shader but it appears RealityKit only registers the default color of (0.18, 0.18, 0.18) (from here https://openusd.org/dev/spec_usdpreviewsurface.html)

(
    defaultPrim = "Root"
    upAxis = "Z"
)

def Xform "Root"
{
    def Xform "Red_block" (
        apiSchemas = ["PhysicsMassAPI", "PhysicsRigidBodyAPI", "PhysxRigidBodyAPI"]
    )
    {
        float physics:mass = 1
        bool physxRigidBody:disableGravity = 0
        bool physxRigidBody:retainAccelerations = 0
        token ui:displayGroup = "Material Graphs"
        token ui:displayName = "Red_block"
        int ui:order = 1024
        float3 xformOp:rotateXYZ = (0, -0, 0)
        float3 xformOp:scale = (1, 1, 1)
        double3 xformOp:translate = (0, 0, 0)
        uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]

        def "geometry"
        {
            def Cube "mesh" (
                apiSchemas = ["PhysicsCollisionAPI", "PhysxCollisionAPI", "MaterialBindingAPI"]
            )
            {
                rel material:binding = </Root/Red_block/geometry/material> (
                    bindMaterialAs = "strongerThanDescendants"
                )
                rel material:binding:physics = </Root/Red_block/geometry/material> (
                    bindMaterialAs = "strongerThanDescendants"
                )
                bool physics:collisionEnabled = 1
                float physxCollision:contactOffset = 0.01
                float physxCollision:restOffset = 0
                double size = 0.05
                quatd xformOp:orient = (1, 0, 0, 0)
                double3 xformOp:scale = (1, 1, 1)
                double3 xformOp:translate = (0, 0, 0)
                uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"]
            }

            def Material "material" (
                apiSchemas = ["PhysicsMaterialAPI", "PhysxMaterialAPI"]
            )
            {
                token outputs:displacement.connect = </Root/Red_block/geometry/material/Shader.outputs:displacement>
                token outputs:surface.connect = </Root/Red_block/geometry/material/Shader.outputs:surface>
                float physics:dynamicFriction = 0.5
                float physics:restitution = 0
                float physics:staticFriction = 10
                float physxMaterial:compliantContactDamping = 0
                float physxMaterial:compliantContactStiffness = 0
                uniform token physxMaterial:frictionCombineMode = "max"
                uniform token physxMaterial:restitutionCombineMode = "min"

                def Shader "Shader"
                {
                    uniform token info:id = "UsdPreviewSurface"
                    float3 inputs:diffuseColor = (1, 0, 0)
                    float3 inputs:emissiveColor = (0, 0, 0)
                    int inputs:metallic = 0
                    float inputs:opacity = 1
                    float inputs:roughness = 0.5
                    token outputs:displacement
                    token outputs:surface
                }
            }
        }
    }
}

Here are some more screenshots from RCP. This should be a red block (based on the usda export shown in the other comment).

The binding appears to be correct?

I exported this from IsaacSim, where it does appear to be the correct color.

@ericD_TRI Fantastic, a USDA file is very helpful!

I think I understand what is going on, and there is indeed a divergence in how Reality Composer Pro is rendering content vs. how Finder renders. See Validating feature support for USD files for more information, but the TLDR is that there are slight differences in the renderer used in Finder (Hydra Storm) and the renderer used in Reality Composer Pro (RealityKit), and these differences are causing your USDA to look correct in Finder while looking gray in RCP.

However! Your USDA file looks strange, and there are things you can do to fix it. It looks like you've merged a physics material with a rendering material, and the physics fields are causing the material to break in Reality Composer Pro (but don't break in Finder). I'm not sure how you generated this USDA file (did you edit it by hand?) but try replacing the block starting with def Material "material" ( with this code, which is simpler:

def Material "material"
{
    token outputs:mtlx:surface
    token outputs:realitykit:vertex
    prepend token outputs:surface.connect = </Root/Red_block/geometry/material/DefaultSurfaceShader.outputs:surface>

    def Shader "DefaultSurfaceShader"
    {
        uniform token info:id = "UsdPreviewSurface"
        color3f inputs:diffuseColor = (1, 0, 0) (
            colorSpace = "lin_srgb"
        )
        float inputs:roughness = 0.75
        token outputs:surface
    }
}

This should make your model completely red.

Let me know if that works or if you have any further questions!

EDIT: Fixed the path to the shader in my USD code snipped above. Please try again if you tried the previous version and it didn't work.

This is the definition of this asset per the framework from isaaclab mentioned in my response to your comment:

red_block = RigidObjectCfg(
    prim_path="/World/envs/env_.*/Red_block",
    init_state=RigidObjectCfg.InitialStateCfg(
        pos=[-4.1, -4.08, 0.84], rot=[1, 0, 0, 0]
    ),
    spawn=sim_utils.CuboidCfg(
        size=(0.075, 0.075, 0.075),
        rigid_props=sim_utils.RigidBodyPropertiesCfg(
            disable_gravity=False, retain_accelerations=False
        ),
        mass_props=sim_utils.MassPropertiesCfg(mass=1.0),
        collision_props=sim_utils.CollisionPropertiesCfg(
            collision_enabled=True, contact_offset=0.01, rest_offset=0.0
        ),
        visual_material=sim_utils.PreviewSurfaceCfg(
            diffuse_color=(1.0, 0.0, 0.0), metallic=0
        ),
        physics_material=sim_utils.RigidBodyMaterialCfg(
            friction_combine_mode="max",
            restitution_combine_mode="min",
            static_friction=10,
            dynamic_friction=0.5,
            restitution=0.0,
        ),
    ),
)
Having trouble with USD material not showing correct color
 
 
Q