---
title: "init(from:geometryModifier:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/custommaterial/init(from:geometrymodifier:)"
---

# init(from:geometryModifier:)

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

## Declaration

```swift
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

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

## See Also

### Creating custom materials

- [init(from:surfaceShader:geometryModifier:)](realitykit/custommaterial/init(from:surfaceshader:geometrymodifier:).md)
- [init(surfaceShader:geometryModifier:lightingModel:)](realitykit/custommaterial/init(surfaceshader:geometrymodifier:lightingmodel:).md)
- [init(program:)](realitykit/custommaterial/init(program:).md)
