# Instanced shaders and connections broken?

**URL:** <https://forum.aousd.org/t/instanced-shaders-and-connections-broken/666>\
**Category:** USD\
**Created:** [September 17, 2023, 3:32pm UTC](https://forum.aousd.org/t/instanced-shaders-and-connections-broken/666 "2023-09-17T15:32:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![olihey](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/olihey/32/92_2.png) [@olihey](https://forum.aousd.org/u/olihey)\
**Post date:** [September 17, 2023, 3:32pm UTC](https://forum.aousd.org/t/instanced-shaders-and-connections-broken/666/1 "2023-09-17T15:32:34Z")

</div>

Hej, I have to following file and didn’t expect the resulting image.

```auto
#usda 1.0
def Sphere "sr" (prepend apiSchemas = ["MaterialBindingAPI"]) {
    rel material:binding = </red_material>
}
def Sphere "sg" (prepend apiSchemas = ["MaterialBindingAPI"]) {
    rel material:binding = </green_material>
    double3 xformOp:translate = (2, 0, 0)
    uniform token[] xformOpOrder = ["xformOp:translate"]
}
def Sphere "sb" (prepend apiSchemas = ["MaterialBindingAPI"]) {
    rel material:binding = </blue_material>
    double3 xformOp:translate = (4, 0, 0)
    uniform token[] xformOpOrder = ["xformOp:translate"]
}
def Material "material"
{
    token outputs:surface.connect = </material/usd_preview.outputs:surface>
    color3f inputs:LEGO:diffuse_color = (0.6, 0.8, 1.0)
    def Shader "usd_preview"
    {
        uniform token info:id = "UsdPreviewSurface"
        color3f inputs:diffuseColor.connect = </material.inputs:LEGO:diffuse_color>
        token outputs:surface
    }
}
def "red_material" (
    references = </material>
) {
}
def "green_material" (
    references = </material>
) {
    color3f inputs:LEGO:diffuse_color = (0.0, 1.0, 0.0)
}
def "blue_material" (
    instanceable = true
    references = </material>
) {
    color3f inputs:LEGO:diffuse_color = (0.0, 0.0, 1.0)
}

```

and I get this in usdview (22.11 / Windows 10)

 ![usdview](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/8f75a2c02fe3ce06e4af9ddb130d487a03ea4b39.png)

Why is the sphere `sb` not blue when I use instancing? I only “overwrite” the `inputs:LEGO:diffuse_color` attribute of the root node? Or is the the connection between nodes in the subgraph and node that references broken?  
Also, why is the `sb` sphere (right) gray and not bright blue as the `sr` (left)? This is the “default” color I set in the `material` Material.

---

<div class="post-metadata">

**Author:** ![spiff](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/spiff/32/22_2.png) [@spiff](https://forum.aousd.org/u/spiff)\
**Post date:** [September 18, 2023, 4:58am UTC](https://forum.aousd.org/t/instanced-shaders-and-connections-broken/666/2 "2023-09-18T04:58:00Z")

</div>

I think this is a bug, and the bug is (I surmise based on your example) that usdImaging is processing the **prototype** instead of the instance (ie proxy prims). The root prim of a prototype has no properties, so the connection would find no valid target, and therefore fall back to some lower down fallback, gray.

Can you file an Issue?
