<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/CustomMaterial/init(from:geometryModifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14CustomMaterialV4from16geometryModifierAcA0D0_p_AC08GeometryG0VtKcfc"
  },
  "title" : "init(from:geometryModifier:)"
}
-->

# init(from:geometryModifier:)

Creates a custom material from an existing material and a geometry
modifier.

```
init(from material: any Material, geometryModifier: CustomMaterial.GeometryModifier) throws
```

## Parameters

`material`

The material on which to base the custom material.

`geometryModifier`

The geometry modifier shader function.

## Discussion

Use this initializer to create a custom material with the same
properties as another existing material, but with a geometry modifier.

---

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)