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