One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhysicallyBasedMaterial.Roughness

struct · iOS 15.0+ · SDK 27.1

struct Roughness

An object that defines the roughness of an entity’s surface. Use this struct to specify the roughness of the entity. The `roughness` property represents how much the surface of the entity scatters light that it reflects. A material with a high roughness has a matte appearance, whereas one with a low roughness has a shiny appearance. For more information, see ``PhysicallyBasedMaterial/roughness-swift.property``.

Members (8)

init · iOS 15.0+

init

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

Creates an object from a single value. The `roughness` property represents how much the surface of the entity scatters light it reflects. A material with a high roughness has a matte appearance, while one with a low roughness has a shiny appearance. ![An illustration showing three spheres with different amounts of roughness. The sphere on the left has a low roughness and looks like shiny, polished plastic. The sphere in the middle has a matte appearance with very soft specular highlights. The sphere on the right has no highlights whatsoever.](PhysicallyBasedMaterial-Roughness-swift-struct-init(floatLiteral:)-1) Use this initializer to create an object to specify the amount of roughness using a single value that applies to the entire material. - Parameters: - value: The roughness value.

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_Roughness
Swift declaration
init(scale: Float = 1.0, texture: PhysicallyBasedMaterial.Texture? = nil)

Creates a roughness object from a color or texture. The `roughness` property represents how much the surface of the entity scatters light it reflects. A material with a high roughness has a matte appearance, while one with a low roughness has a shiny appearance. ![An illustration showing three spheres with different amounts of roughness. The sphere on the left has a low roughness and looks like shiny, polished plastic. The sphere in the middle has a matte appearance with very soft specular highlights. The sphere on the right has no highlights whatsoever.](PhysicallyBasedMaterial-Roughness-swift-struct-init(scale:texture:)-1) Use this initializer to create a new object from a single roughness value, from an image texture, or from both. If you specify `texture`, RealityKit calculates the `roughness` 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 roughness. 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: The roughness value. - texture: An optional image texture.

get · iOS 15.0+

scale

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

The roughness value for the entire entity.

set · iOS 15.0+

scale

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

The roughness value for the entire entity.

get · iOS 15.0+

texture

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

The roughness values 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 roughness values as a UV-mapped image texture.

init · iOS 15.0+

init

TypeScript
static init(value: CustomMaterial_Roughness): PhysicallyBasedMaterial_Roughness
Swift declaration
init(_ value: CustomMaterial.Roughness)

Creates a roughness object from a custom material’s roughness property. - Parameters: - value: The custom material’s roughness property.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →