One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

CustomMaterial.BaseColor

struct · iOS 15.0+ · SDK 27.1

struct BaseColor

An object that defines an entity’s base color. For more information on using base color values in a custom material, see ``CustomMaterial/baseColor-swift.property``.

Members (3)

get · iOS 15.0+

texture

TypeScript
get texture(): (CustomMaterial_CustomMaterialTexture) | null
Swift declaration
var texture: CustomMaterial.Texture?

The base color as a UV-mapped image.

set · iOS 15.0+

texture

TypeScript
set texture(value: (CustomMaterial_CustomMaterialTexture) | null)
Swift declaration
var texture: CustomMaterial.Texture?

The base color as a UV-mapped image.

init · iOS 15.0+

init

TypeScript
static init(value: PhysicallyBasedMaterial_BaseColor): CustomMaterial_BaseColor
Swift declaration
init(_ value: PhysicallyBasedMaterial.BaseColor)

Creates a custom base color object from an existing physically based material’s base color object. Use this initializer to create a ``CustomMaterial/BaseColor-swift.struct`` that contains the same tint and texture values as an existing ``PhysicallyBasedMaterial/BaseColor-swift.struct`` object. Both `tint` and `texture` from the ``PhysicallyBasedMaterial/BaseColor-swift.struct`` object are available in your surface shader, but RealityKit doesn’t automatically use those values to render the entity. Your surface shader needs to calculate the final base color value for each pixel and assign it by calling `params.surface().set_base_color()`. For more information on creating custom materials and writing shader functions, see <doc:modifying-realitykit-rendering-using-custom-materials>. - Parameters: - value: The base color object from a physically based material.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →