An object that provides environmental lighting information for a specific area of space in a world-tracking AR session.
SDK
- iOS 12.0+
Framework
- ARKit
Declaration
class AREnvironmentProbeAnchor : ARAnchor
Overview
Environment textures depict the view in all directions from a specific point in a scene. In 3D asset rendering, environment textures are the basis for image-based lighting algorithms where surfaces can realistically reflect light from their surroundings. ARKit can generate environment textures during an AR session using camera imagery, allowing SceneKit or a custom rendering engine to provide realistic image-based lighting for virtual objects in your AR experience.
To enable texture map generation for an AR session, set the environment
property:
With
ARWorld
environment texturing, you identify points in the scene for which you want light probe texture maps by creatingTracking Configuration .Environment Texturing .manual AREnvironment
objects and adding them to the session.Probe Anchor With
ARWorld
environment texturing, ARKit automatically creates, positions, and addsTracking Configuration .Environment Texturing .automatic AREnvironment
objects to the session.Probe Anchor
In both cases, ARKit automatically generates environment textures as the session collects camera imagery. Use a delegate method such as session(_:
to find out when a texture is available, and access it from the anchor's environment
property.
If you display AR content using ARSCNView
and the automatically
option, SceneKit automatically retrieves AREnvironment
texture maps and uses them to light the scene.