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

# init(_:)

Creates a custom base color object from an existing physically based
material’s base color object.

```
init(_ value: PhysicallyBasedMaterial.BaseColor)
```

## Parameters

`value`

The base color object from a physically based material.

## Discussion

Use this initializer to create a
[`CustomMaterial.BaseColor`](/documentation/RealityKit/CustomMaterial/BaseColor-swift.struct) that contains the same
tint and texture values as an existing
[`PhysicallyBasedMaterial.BaseColor`](/documentation/RealityKit/PhysicallyBasedMaterial/BaseColor-swift.struct) object.

Both `tint` and `texture` from the
[`PhysicallyBasedMaterial.BaseColor`](/documentation/RealityKit/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
[Modifying RealityKit rendering using custom materials](/documentation/RealityKit/modifying-realitykit-rendering-using-custom-materials).

---

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)