PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.03k stars 1.19k forks source link

Light linking on instanceable references doesn't seem to work with USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1 #3306

Open robpieke opened 1 week ago

robpieke commented 1 week ago

Using USD 24.08 and both the RenderMan delegate and our Karma delegate, we're observing that light linking against instanceable references no longer works (in both usdview and the Solaris viewport). Not sure if there's a missing/misconfigured Scene Index in the chain, but this is what we get out of the box.

lgtlink

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

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

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

def "i_sphere1" (
    instanceable = true
    prepend references = </sphere1>
)
{
    matrix4d xformOp:transform:transform1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) )
    uniform token[] xformOpOrder = ["xformOp:transform:transform1"]
}

def "i_sphere2" (
    instanceable = true
    prepend references = </sphere2>
)
{
    matrix4d xformOp:transform:transform2 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) )
    uniform token[] xformOpOrder = ["xformOp:transform:transform2"]
}

def Xform "lights"
{
    def DistantLight "lgt_red" 
    {
        rel collection:lightLink:excludes = None
        uniform token collection:lightLink:expansionRule = "expandPrims"
        uniform bool collection:lightLink:includeRoot = 0
        rel collection:lightLink:includes = [
            </i_sphere2>,
            </sphere2>,
        ]
        color3f inputs:color = (1, 0, 0)
        bool inputs:normalize = 0
        matrix4d xformOp:transform = ( (0.5, -0.866, -0, 0), (0, 0, -1, 0), (0.866, 0.5, -0, 0), (0, 0, -0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }

    def DistantLight "lgt_green" 
    {
        rel collection:lightLink:excludes = None
        uniform token collection:lightLink:expansionRule = "expandPrims"
        uniform bool collection:lightLink:includeRoot = 0
        rel collection:lightLink:includes = [
            </i_sphere1>,
            </sphere1>,
        ]
        color3f inputs:color = (0, 1, 0)
        bool inputs:normalize = 0
        matrix4d xformOp:transform = ( (0.5, 0.866, -0, 0), (0, 0, -1, 0), (-0.866, 0.5, -0, 0), (0, 0, -0, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }
}
jesschimein commented 1 week ago

Filed as internal issue #USD-10162