File size: 1,660 Bytes
16e4eae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#usda 1.0
(
    defaultPrim = "Root"
    metersPerUnit = 1.0
    upAxis = "Z"
)

def "Root"
{
    def Material "MatDirect"
    {
        token outputs:surface.connect = </Root/MatDirect/Preview.outputs:surface>

        def Shader "Preview"
        {
            uniform token info:id = "UsdPreviewSurface"
            token outputs:surface

            # A touch of realism: a base color input
            color3f inputs:diffuseColor = (0.8, 0.2, 0.2)
        }
    }

    def Material "MatGraph"
    {
        token outputs:surface.connect = </Root/MatGraph/Graph.outputs:surface>

        def NodeGraph "Graph"
        {
            token outputs:surface.connect = </Root/MatGraph/Graph/Inner.outputs:surface>

            def Shader "Inner"
            {
                uniform token info:id = "UsdPreviewSurface"
                token outputs:surface
                color3f inputs:diffuseColor = (0.2, 0.6, 0.9)
            }
        }
    }

    def Xform "Geom"
    {
        def Mesh "MeshDirect"
        {
            # A simple square made of 2 triangles
            int[] faceVertexCounts = [3, 3]
            int[] faceVertexIndices = [0, 1, 2, 2, 3, 0]
            point3f[] points = [(-1, -1, 0), (0, -1, 0), (0, 0, 0), (-1, 0, 0)]

            rel material:binding = </Root/MatDirect>
        }

        def Mesh "MeshGraph"
        {
            int[] faceVertexCounts = [3, 3]
            int[] faceVertexIndices = [0, 1, 2, 2, 3, 0]
            point3f[] points = [(0, 0, 0), (1, 0, 0), (1, 1, 0), (0, 1, 0)]

            rel material:binding = </Root/MatGraph>
        }
    }
}