One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicallyBasedMaterial.Metallic

struct · iOS 15.0+ · SDK 27.1

struct Metallic

An object that defines the reflectiveness of an entity. Use this struct to specify an entity’s `metallic` property, which specifies the reflectiveness of an entity. For more information, see ``PhysicallyBasedMaterial/metallic-swift.property``.

Members (8)

init · iOS 15.0+

init

TypeScript
static initFloatLiteral(value: number): PhysicallyBasedMaterial_Metallic
Swift declaration
init(floatLiteral value: Float)

Creates an object from single value. In PBR rendering, the `metallic` property represents the reflectiveness of an entity. This initializer creates a new object from a single value to describe the reflectiveness of the entire material. A value of 0.0 creates a _dielectric_ (or non-reflective) material. Values greater than 0.0 result in an increasingly _metallic_ (or reflective) materials. ![An illustration showing two spheres rendered in RealityKit. The sphere on the left is shiny but dielecric so doesn’t reflect the surrounding environment other than specular highlights from the visible light. The sphere on the right is metallic and reflects all of the surrounding environment like a mirror ball.](PhysicallyBasedMaterial-Metallic-swift-struct-init(floatLiteral:)-1) - Parameters: - value: The reflectiveness value for the material.

get · iOS 15.0+

textureSemantic

TypeScript
static get textureSemantic(): TextureResource_Semantic
Swift declaration
static let textureSemantic: TextureResource.Semantic

The intended use of the object’s texture property.

init · iOS 15.0+

init

TypeScript
static initScaleTexture(scale?: number, texture?: (MaterialParameters_Texture) | null): PhysicallyBasedMaterial_Metallic
Swift declaration
init(scale: Float = 1.0, texture: PhysicallyBasedMaterial.Texture? = nil)

Creates an object from a color or texture. In PBR rendering, the `metallic` property represents the reflectiveness of an entity. This initializer creates a new object from a single value to describe the reflectiveness of the entire material. This initializer creates a new object from a single value or a grayscale image texture, or from both. If you specify `texture`, RealityKit calculates the `metallic` for the entity by UV-mapping `texture` onto the entity and multiplying the value of each mapped pixel by `scale`. If you don’t specify `texture`, then RealityKit uses `scale` as the entire entity’s reflectiveness. If you provide a color image for `texture` rather than a grayscale image, RealityKit only uses the intensity of the image’s red channel. ![An illustration showing two spheres rendered in RealityKit. The sphere on the left is shiny but dielecric so doesn’t reflect the surrounding environment other than specular highlights from the visible light. The sphere on the right is metallic and reflects all of the surrounding environment like a mirror ball.](PhysicallyBasedMaterial-Metallic-swift-struct-init(scale:texture:)-1) - Parameters: - scale: The reflectiveness value. - texture: An optional image texture.

get · iOS 15.0+

scale

TypeScript
get scale(): number
Swift declaration
var scale: Float

The reflectiveness for the entire entity.

set · iOS 15.0+

scale

TypeScript
set scale(value: number)
Swift declaration
var scale: Float

The reflectiveness for the entire entity.

get · iOS 15.0+

texture

TypeScript
get texture(): (MaterialParameters_Texture) | null
Swift declaration
var texture: PhysicallyBasedMaterial.Texture?

The reflectiveness as a UV-mapped image texture.

set · iOS 15.0+

texture

TypeScript
set texture(value: (MaterialParameters_Texture) | null)
Swift declaration
var texture: PhysicallyBasedMaterial.Texture?

The reflectiveness as a UV-mapped image texture.

init · iOS 15.0+

init

TypeScript
static init(value: CustomMaterial_Metallic): PhysicallyBasedMaterial_Metallic
Swift declaration
init(_ value: CustomMaterial.Metallic)

Creates a metallic object from a custom material’s metallic property. In PBR rendering, the `metallic` property represents the reflectiveness of an entity. This initializer creates a new object from the ``CustomMaterial/metallic-swift.property`` property of a ``CustomMaterial``. - Parameters: - value: The custom material’s metallic property.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →