<!--
{
  "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/Custom-swift.struct/init(value:texture:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14CustomMaterialV0C0V5value7textureAEs5SIMD4VySfG_AC0cD7TextureVSgtcfc"
  },
  "title" : "init(value:texture:)"
}
-->

# init(value:texture:)

Creates a custom object from a vector and texture.

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

## Parameters

`value`

A four-component vector.

`texture`

An optional texture.

## Discussion

Use this initializer to create a new
[`CustomMaterial.Custom`](/documentation/RealityKit/CustomMaterial/Custom-swift.struct) 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.

---

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)