swiftrealitykitvisionosreality-composer-pro

How to programatically set ShaderGraphMaterial properties?


I have successfully loaded a ShaderGraphMaterial object from a Reality Composer Pro usda file -- here is a the graph program:

enter image description here

When I attempt to set a parameter

try shotTrailMaterial?.setParameter(name: "TimeDelay.Value", value: .float(1.0))

I get a parameterNameNotFound exception. What am I missing? What is the trick to defining and/or accessing these shader parameters?


Solution

  • Here's a sequence of actions to create MaterialX controlled parameter in ShaderGraph:

    enter image description here