Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment of materials which are instanceable references doesn't seem to work with USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1 #3307

Open
robpieke opened this issue Sep 20, 2024 · 1 comment

Comments

@robpieke
Copy link
Contributor

Using USD 24.08 and both the RenderMan delegate and our Karma delegate, we're observing that material assignment fails when the material being assigned is an instanceable reference.

instmat

#usda 1.0
(
    endTimeCode = 1
    framesPerSecond = 24
    metersPerUnit = 1
    startTimeCode = 1
    timeCodesPerSecond = 24
    upAxis = "Y"
)

def Xform "sphere1" (
    prepend apiSchemas = ["MaterialBindingAPI"]
)
{
    rel material:binding = </materials/mtlxmaterial>

    def Sphere "sphere"
    {
        double radius = 1
        matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-1, 0, 0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }
}

def Xform "sphere2" (
    prepend apiSchemas = ["MaterialBindingAPI"]
)
{
    rel material:binding = </materials/i_mtlxmaterial>

    def Sphere "sphere"
    {
        double radius = 1
        matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (1, 0, 0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }
}

def Scope "materials"
{
    def Material "mtlxmaterial" (
        prepend inherits = </__class_mtl__/mtlxmaterial>
    )
    {
        token outputs:mtlx:displacement.connect = </materials/mtlxmaterial/mtlxdisplacement.outputs:out>
        token outputs:mtlx:surface.connect = </materials/mtlxmaterial/mtlxstandard_surface.outputs:out>

        def Shader "mtlxstandard_surface"
        {
            uniform token info:id = "ND_standard_surface_surfaceshader"
            color3f inputs:base_color = (1, 0, 0) 
            token outputs:out
        }

        def Shader "mtlxdisplacement"
        {
            uniform token info:id = "ND_displacement_float"
            token outputs:out
        }
    }

    def "i_mtlxmaterial" (
        instanceable = true
        prepend references = </materials/mtlxmaterial>
    )
    {
    }
}
@jesschimein
Copy link
Contributor

Filed as internal issue #USD-10163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants