Contents

init(value:texture:)

Creates a custom object from a vector and texture.

Declaration

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 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.