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``.
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.
-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.
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.
-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.