hydra-rs 0.0.2

Rust bindings to OpenUSD's Hydra rendering layer: scene-index ingestion, render-delegate enumeration, headless render to RGBA via Storm.
#usda 1.0
(
    defaultPrim = "World"
    upAxis = "Y"
)

def Xform "World"
{
    double3 xformOp:translate = (10, 0, 0)
    uniform token[] xformOpOrder = ["xformOp:translate"]

    def Mesh "Cube" (
        prepend apiSchemas = ["MaterialBindingAPI"]
    )
    {
        uniform token subdivisionScheme = "none"
        rel material:binding = </World/Looks/CubeMat>
        int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
        int[] faceVertexIndices = [
            0, 1, 3, 2,
            2, 3, 5, 4,
            4, 5, 7, 6,
            6, 7, 1, 0,
            1, 7, 5, 3,
            6, 0, 2, 4
        ]
        point3f[] points = [
            (-0.5, -0.5,  0.5), ( 0.5, -0.5,  0.5),
            (-0.5,  0.5,  0.5), ( 0.5,  0.5,  0.5),
            (-0.5,  0.5, -0.5), ( 0.5,  0.5, -0.5),
            (-0.5, -0.5, -0.5), ( 0.5, -0.5, -0.5)
        ]
        normal3f[] normals = [
            (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1),
            (0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0),
            (0, 0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1),
            (0, -1, 0), (0, -1, 0), (0, -1, 0), (0, -1, 0),
            (1, 0, 0), (1, 0, 0), (1, 0, 0), (1, 0, 0),
            (-1, 0, 0), (-1, 0, 0), (-1, 0, 0), (-1, 0, 0)
        ] (
            interpolation = "faceVarying"
        )
        texCoord2f[] primvars:st = [
            (0, 0), (1, 0), (1, 1), (0, 1)
        ] (
            interpolation = "faceVarying"
        )
        int[] primvars:st:indices = [
            0, 1, 2, 3,
            0, 1, 2, 3,
            0, 1, 2, 3,
            0, 1, 2, 3,
            0, 1, 2, 3,
            0, 1, 2, 3
        ]
    }

    def Sphere "Ball"
    {
        double radius = 1.0
    }

    def Scope "Looks"
    {
        def Material "CubeMat"
        {
            token outputs:surface.connect = </World/Looks/CubeMat/Surface.outputs:surface>

            def Shader "Surface"
            {
                uniform token info:id = "UsdPreviewSurface"
                color3f inputs:diffuseColor.connect = </World/Looks/CubeMat/DiffuseTex.outputs:rgb>
                float inputs:roughness.connect = </World/Looks/CubeMat/RoughTex.outputs:r>
                token outputs:surface
            }

            def Shader "DiffuseTex"
            {
                uniform token info:id = "UsdUVTexture"
                asset inputs:file = @./textures/diffuse.png@
                float3 outputs:rgb
            }

            def Shader "RoughTex"
            {
                uniform token info:id = "UsdUVTexture"
                asset inputs:file = @./textures/roughness.png@
                float outputs:r
            }
        }
    }
}