<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ShaderGraphMaterial/init(named:from:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19ShaderGraphMaterialV5named4from2inACSS_SSSo8NSBundleCSgtYaKcfc"
  },
  "title" : "init(named:from:in:)"
}
-->

# init(named:from:in:)

Loads a ShaderGraphMaterial from a bundle.

```
init(named name: String, from file: String, in bundle: Bundle? = nil) async throws
```

## Parameters

`name`

The name of the ShaderGraphMaterial within the file.
For USD files, this is the full path of the material prim (such as “/Root/MyMaterial”).

`file`

The name of the file within the bundle.

`bundle`

The bundle containing the resource. Specify nil to search the app’s main
bundle.

## Return Value

A ShaderGraphMaterial object from the file with the name specified.

## Discussion

Supported file formats are USD (.usd, .usda, .usdc, .usdz) and Reality File (.reality).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)