Light estimation
Light estimation is a technique for replicating the lighting conditions of the real world and applying it to our 3D virtual objects. Ideally, we would like to be able to replicate the exact lighting conditions, but of course, we're not there yet. ARCore currently uses an image analysis algorithm to determine light intensity based on the current image from the device. This is then applied as global light to the 3D objects in the scene. Open up Unity again and let's see how this is done by following along the given steps:
- Locate the
AndyMaterial
again and revert its shader toARCore/DiffuseWithLightEstimation
. - Save the project (
File
|Save Project
). - Connect your device and type Ctrl + B (command + B on Mac) to build and run the app on your device. Place a couple of
Andy
models and alter the lighting conditions. Note how our objects respond to the changes in lighting. Go back to Unity and double-click on the
HelloAR
scene in theAssets/GoogleARCore/HelloARExample/Scenes
folder...