O'Reilly logo

Learn ARCore - Fundamentals of Google ARCore by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lighting and shadows

Lighting is an essential element in our scenes, but as we have already seen, it takes some work to get it right. In this section, we will revisit lighting and also tackle adding shadows. Adding shadows to our objects will make them look like they are really there. We will start with adding shadows, so open up Unity and follow along:

  1. Create a new shader called UnlitShadowReceiver in the Assets/ARCoreDesign/Materials/Shaders folder.
  2. Double-click on the new shader to open it in your code editor.
  3. Select all the autogenerated code and delete it. Then, add the following code:
Shader "ARCoreDesign/UnlitShadowReceiver" { Properties {   _Color("Main Color", Color) = (1,1,1,1)   _MainTex("Base (RGB)", 2D) = "white" {}  _Cutoff("Cutout", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required