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.

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