One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicallyBasedMaterial.Specular

struct · iOS 15.0+ · SDK 27.1

struct Specular

An object that defines the specular highlights of an entity. RealityKit automatically draws _specular highlights_ for physically based materials, using the values of various properties, primarily ``PhysicallyBasedMaterial/roughness-swift.property`` and ``PhysicallyBasedMaterial/metallic-swift.property``. Specular highlights are bright spots of reflected light that appear on shiny objects. ![An illustration showing a sphere and a cube with rounded corners. Both have a shiny surface and a small white spot labeled “specular highlights” where they reflect the scene’s light source.](PhysicallyBasedMaterial-Specular-swift-struct-1) Although many real-world objects can be accurately and realistically simulated with just the core physically based rendering (PBR) properties, you can create additional realistic effects by augmenting the specular highlights. Use this object to specify the amount of ``PhysicallyBasedMaterial/specular-swift.property`` for a ``PhysicallyBasedMaterial``.

Members (8)

init · iOS 15.0+

init

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

Creates an object from single value. RealityKit automatically draws _specular highlights_ for physically based materials using the values of various properties, primarily ``PhysicallyBasedMaterial/roughness-swift.property`` and ``PhysicallyBasedMaterial/metallic-swift.property``. Specular highlights are bright spots of reflected light that appear on shiny objects. ![An illustration showing a sphere and a cube with rounded corners. Both have a shiny surface and a small white spot labeled “specular highlights” where they reflect the scene’s light source.](PhysicallyBasedMaterial-Specular-swift-struct-init(floatLiteral:)-1) While many real-world objects can be accurately and realistically simulated with just the core PBR properties, you can create additional realistic effects by augmenting the specular highlights. This initializer creates a ``PhysicallyBasedMaterial/Specular-swift.struct`` object from a single value that applies to the entire material. - Parameters: - value: A value from 0.0 to 1.0 to use as the specular 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_Specular
Swift declaration
init(scale: Float = 1.0, texture: PhysicallyBasedMaterial.Texture? = nil)

Creates an object from a single value or a texture. RealityKit automatically draws _specular highlights_ for physically based materials using the values of various properties, primarily ``PhysicallyBasedMaterial/roughness-swift.property`` and ``PhysicallyBasedMaterial/metallic-swift.property``. Specular highlights are bright spots of reflected light that appear on shiny objects. ![An illustration showing a sphere and a cube with rounded corners. Both have a shiny surface and a small white spot labeled “specular highlights” where they reflect the scene’s light source.](PhysicallyBasedMaterial-Specular-swift-struct-init(scale:texture:)-1) While many real-world objects can be accurately and realistically simulated with just the core PBR properties, you can create additional realistic effects by augmenting the specular highlights. This initializer creates a ``PhysicallyBasedMaterial/Specular-swift.struct`` object from a single value, an image texture, or both. If you specify `texture`, RealityKit calculates the `specular` 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`, RealityKit uses `scale` as the entire entity’s specular. If you provide a color image for `texture` rather than a grayscale image, RealityKit only uses the intensity of the image’s red channel. - Parameters: - scale: A value from 0.0 to 1.0 to use as the specular value for the material. - texture: An optional UV-mapped image texture.

get · iOS 15.0+

scale

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

The amount of specular for the entire entity.

set · iOS 15.0+

scale

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

The amount of specular for the entire entity.

get · iOS 15.0+

texture

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

The amount of specular 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 amount of specular as a UV-mapped image texture.

init · iOS 15.0+

init

TypeScript
static init(value: CustomMaterial_Specular): PhysicallyBasedMaterial_Specular
Swift declaration
init(_ value: CustomMaterial.Specular)

Creates an object from a custom material’s specular property. RealityKit automatically draws _specular highlights_ for physically based materials using the values of various properties, primarily ``PhysicallyBasedMaterial/roughness-swift.property`` and ``PhysicallyBasedMaterial/metallic-swift.property``. Specular highlights are bright spots of reflected light that appear on shiny objects. ![An illustration showing a sphere and a cube with rounded corners. Both have a shiny surface and a small white spot labeled “specular highlights” where they reflect the scene’s light source.](PhysicallyBasedMaterial-Specular-swift-struct-init(_:)-1) While many real-world objects can be accurately and realistically simulated with just the core PBR properties, you can create additional realistic effects by augmenting the specular highlights. This initializer creates a ``PhysicallyBasedMaterial/Specular-swift.struct`` object from the specular property of a ``CustomMaterial``. - Parameters: - value: The custom material’s specular property.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →