LightEstimator

class LightEstimator(val engine: Engine, val iblPrefilter: IBLPrefilter)

Per frame AR light estimation

ARCore will estimate lighting to provide directional light, ambient spherical harmonics, and reflection cubemap estimation

A key part for creating realistic AR experiences is getting the lighting right. When a virtual object is missing a shadow or has a shiny material that doesn't reflect the surrounding space, users can sense that the object doesn't quite fit, even if they can't explain why. This is because humans subconsciously perceive cues regarding how objects are lit in their environment. The Lighting Estimation API analyzes given images for such cues, providing detailed information about the lighting in a scene. You can then use this information when rendering virtual objects to light them under the same conditions as the scene they're placed in, keeping users grounded and engaged.

Constructors

Link copied to clipboard
constructor(engine: Engine, iblPrefilter: IBLPrefilter)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Estimation(var mainLightColor: Color? = null, var mainLightIntensity: Float? = null, var mainLightDirection: Direction? = null, var reflections: Texture? = null, var irradiance: FloatArray? = null)

Properties

Link copied to clipboard
val engine: Engine
Link copied to clipboard

Move the directional light

Link copied to clipboard

Modulate the main directional light (sun) intensity

Link copied to clipboard

Enable reflection cubemap

Link copied to clipboard

SpecularFilter applies a filter based on the BRDF used for lighting

Link copied to clipboard

Ambient spherical harmonics

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun destroy()
Link copied to clipboard
fun update(session: Session, frame: Frame, camera: Camera): LightEstimator.Estimation?