Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Snippet of the EnvironmentalLight code of Google ARCore for Unity
LightEstimate estimate = Frame.LightEstimate;
// Updates directional light
DirectionalLight.transform.rotation = estimate.DirectionalLightRotation;
DirectionalLight.color = estimate.DirectionalLightColor;
// Set ambient probe
RenderSettings.ambientMode = AmbientMode.Skybox;
RenderSettings.ambientProbe = estimate.AmbientProbe;
// Set reflection probe (if activated)
RenderSettings.defaultReflectionMode = DefaultReflectionMode.Custom;
RenderSettings.customReflection = estimate.ReflectionProbe;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment