I have created a custom shader material in Reality Composer Pro (RCP). I can attach it to models in RCP without a problem, but my issue is that I am creating my models in code. I can not figure out how to reference the material in my RCP project.
I'm trying this but getting no luck. I suspect the "Package" string could be incorrect, but the docs don't make it very clear what the string should actually be.
if let puzzleMaterial = try? ShaderGraphMaterial.load(named: "MyCustomMaterial", from: "Package", in: realityKitContentBundle) {
// Do something with the material
} else {
// No luck
}
Entity(named: "MyEntity", in: realityKitContentBundle)
and then somehow get the material component? I haven't found the right recipe yet. – Cooks