---
title: "init(value:texture:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/custommaterial/custom-swift.struct/init(value:texture:)"
---

# init(value:texture:)

Creates a custom object from a vector and texture.

## Declaration

```swift
init(value: SIMD4<Float> = .init(repeating: 0), texture: CustomMaterial.Texture? = nil)
```

## Parameters

- `value`: A four-component vector.
- `texture`: An optional texture.

## Discussion

Discussion Use this initializer to create a new CustomMaterial.Custom object from a four-component vector, a texture, or both. RealityKit passes these values automatically to your custom material’s shader functions. Custom values have no predefined meaning, and RealityKit doesn’t use them other than to make them available in your surface shader and geometry modifier.
