Using Vuforia Fusion Illumination¶
This article provides an overview of the Vuforia Fusion illumination and color correction featurese.
The Illumination Observer contains information about the estimated illumination characteristics of the user's physical environment computed by analyzing the live camera feed. Parameters of the Observation represent a scene's illumination values and lets you render augmentations according to lighting changes of the real-world scene. An Illumination Observation can be returned from the State.
Create an Illumination Observer¶
Use the VuIlluminationConfig
in your AR application to configure and create an Illumination Observer. The Observer is activated by default on creation.
Observations¶
The Illumination Observer produces Observations that are collected in the State. Get the state from the Engine and parse them to the VuIlluminationObservationInfo
.
Destroy Observer and Observation¶
Destroy objects and processes after usage to free up memory.
For Illumination Observers, you call the following to destroy the observationList and Observer.
Destroy ObservationList
Destroy the Observer
Illumination Values¶
ARKit and ARCore produce different illumination values. These values are different for a given lighting setting in the application's environment.
- ARKit generates two physical measurements:
- A color temperature measured in Kelvin.
- An intensity measured in Lumens. In applications such as Unity and SceneKit, these values are easily applied to light used in the rendering.
- ARCore supplies values that can be applied directly to a shader's RGB values, as well as an intensity value.
For each platform, the values are returned in the following elements of the VuIlluminationObservationInfo
:
Platform | Elements |
---|---|
iOS ARKit | ambientColorTemperature in Kelvin and ambientIntensity in Lumen. |
Android ARCore | intensityCorrection between 0.0 (black) and 1.0 (white) and colorCorrection in Vector4 containing RGBA values. |
If the device does not support ARKit, then ambientIntensity
and ambientColorTemperature
returns VU_ILLUMINATION_AMBIENT_INTENSITY_UNAVAILABLE and VU_ILLUMINATION_AMBIENT_COLOR_TEMPERATURE_UNAVAILABLE.
The intensityCorrection
and colorCorrection
elements always return valid values that can be applied to a shader. If ARCore is not used, however, the returned values for intensityCorrection
defaults to 0.466 (middle-grey) and the colorCorrection
is set to 1.
Example Usage¶
The example code below demonstrates how to retrieve, convert, and load the rendered illumination values into the light shader for ARKit and ARCore enabled projects.
iOS ARKit¶
Retrieve the illumination values from the state and convert them to renderable values
Load the rendered values into your light shader algorithm and your lighting objects:
Android ARCore¶
Retrieve the illumination values from the State and convert them to renderable valuess:
Load the rendered values into your light shader algorithm or your lighting objects in OpenGL.