#usda 1.0
(
    doc = "MaterialX material with ACES 2065-1 colorspace (DCI cinema)"
    metersPerUnit = 1
    upAxis = "Y"
    defaultPrim = "World"
)

def Xform "World"
{
    def Cube "ACES2065Cube"
    {
        double size = 1.0
        rel material:binding = </World/_materials/ACES2065Material>

        texCoord2f[] primvars:st = [(0, 0), (1, 0), (1, 1), (0, 1)] (
            interpolation = "vertex"
        )
    }

    def Scope "_materials"
    {
        def Material "ACES2065Material"
        {
            token outputs:surface.connect = </World/_materials/ACES2065Material/OpenPBRSurface.outputs:surface>

            def Shader "OpenPBRSurface"
            {
                uniform token info:id = "OpenPBRSurface"
                color3f inputs:base_color.connect = </World/_materials/ACES2065Material/ACESTexture.outputs:rgb>
                float inputs:base_weight = 1.0
                float inputs:base_metalness = 0.0
                float inputs:specular_roughness = 0.4
                token outputs:surface
            }

            def Shader "ACESTexture"
            {
                uniform token info:id = "UsdUVTexture"
                asset inputs:file = @./textures/checkerboard.png@ (
                    colorSpace = "aces2065-1"
                )
                string inputs:filtertype = "linear"
                float2 inputs:texcoord.connect = </World/_materials/ACES2065Material/PrimvarNode.outputs:result>
                color3f outputs:rgb
            }

            def Shader "PrimvarNode"
            {
                uniform token info:id = "UsdPrimvarReader_float2"
                string inputs:varname = "st"
                float2 outputs:result
            }
        }
    }
}
