Contents

VirtualEnvironmentProbeComponent

A component that provides environment lighting for entities you place within the same virtual world.

Declaration

struct VirtualEnvironmentProbeComponent

Overview

In a fully virtual environment, you can configure the VirtualEnvironmentProbeComponent with an EnvironmentResource to provide precalculated indirect lighting from the environment. RealityKit combines this lighting with other lights in the scene to calculate the final lighting of an entity. The example below shows how you can set up a VirtualEnvironmentProbeComponent from a single probe:

let environment = try await Entity(named: "environment")
let resource = try await EnvironmentResource(named: "MyEnvironment", in: bundle)
let probe = VirtualEnvironmentProbeComponent.Probe(environment: resource)
let probeComponent = VirtualEnvironmentProbeComponent(source: .single(probe))
environment.components.set(probeComponent)

Topics

Structures

Initializers

Instance Properties

Enumerations

See Also

Environment