From the course: AR Development Techniques 02: Lighting and Physics

Shadows created using directional light

From the course: AR Development Techniques 02: Lighting and Physics

Start my 1-month free trial

Shadows created using directional light

- [Instructor] In this video, we'll see how to create shadows using the light object in our scene. So right now we have a direction light object in our scene. This one, and it's very easy to enable shadows for this. Go to inspector and change the shadow type from no shadows to soft shadows. Right now you can see that the shadows are very pixelated. We can make it a little better by going to edit, project settings, quality, and let's expand this. Change the shadow projection from stable fit to close fit. Close this, it looks a lot better now. When you run the app, it will still be a little pixelated, but it will be better than the one we just saw before changing it to the close fit. You can also change the position of the shadows by changing the angle of the direction light. So while directional light is selected, you can change the rotation angle, and this will change the position of the shadows. And you can change the strength of the shadow. Right now it's very dark. You can change the strength in the inspector window. So I'll make this around 0.7. If we run the app right now, this is what we'll see. The shadows look okay, but it's still a little pixelated. We can't really do much about it because that's how the shadow quality is for mobile devices in Unity. There's another type of shadow which can be created using shadow projector. I personally really liked those shadows and we'll talk about it in the next video.

Contents