Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created June 4, 2020 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andijakl/e7ef907354e7501d474d868c7fcf5ce1 to your computer and use it in GitHub Desktop.
Save andijakl/e7ef907354e7501d474d868c7fcf5ce1 to your computer and use it in GitHub Desktop.
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