---
title: "withMutableUniforms(ofType:_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/custommaterial/withmutableuniforms(oftype:_:)"
---

# withMutableUniforms(ofType:_:)

Calls the given closure with an inout reference to the underlying storage bound to the custom uniforms argument of a surface shader and geometry modifier.

## Declaration

```swift
mutating func withMutableUniforms<UniformsType>(ofType: UniformsType.Type, _ callback: (inout UniformsType, inout CustomMaterial.ResourceStorage<UniformsType>) -> Void)
```

## Discussion

Discussion This method operates like withMutableUniforms(ofType:stage:_:) but sets the same value for all stages at once. When using this form, ensure that the custom uniforms arguments passed to each stage of your CustomMaterial are of the same type.

## See Also

### Setting shader properties

- [program](realitykit/custommaterial/program-swift.property.md)
- [custom](realitykit/custommaterial/custom-swift.property.md)
- [lightingModel](realitykit/custommaterial/lightingmodel-swift.property.md)
- [withMutableUniforms(ofType:stage:_:)](realitykit/custommaterial/withmutableuniforms(oftype:stage:_:).md)
