Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
We are going to take a look at how to optimize Shadow Maps in order to get good results. Because Shadow Maps are based on pixels, you'll need to work with them a little bit to avoid some aliasing artifacts, or jagged edges on the shadows. You'll notice that in this version of the scene, I've removed the diffused color map from my backdrop so that we can see the shadows more clearly. Okay. So, what I am looking in the Perspective or Camera Views, you'll see that we are seeing a lot of aliasing.
The shadows are looking really jagged. But you can't trust what you see in the Viewports, and that includes ActiveShade. ActiveShade does not correctly and accurately represent the way Shadow Maps are going to render in a full production rendering. So, I'll need to click my Render Production in order to see what I'm really going to get. Okay, so as you can see, this is a lot cleaner in the full rendering than it is in the Viewport. But it still not terribly clean because we are still getting some strange fringe artifacts here.
So, what can we do about this? Well, we can go into the Light and play around with the Shadow Map parameters. As long as Shadow Maps are enabled, we'll see a Shadow Map parameters roll out. The two most significant parameters here are the Size and Sample Range. Size is actually the resolution of the Shadow Map in pixels. It's basically an image that's 512 X 512 pixels. It's being spread across the area is defined by the Falloff radius of the spotlight.
Sample Range is a blur factor that's applied to the shadow to soften it up. In order to see this more dramatically, I am going to turn the Sample Range, or the Blur, down to let's say 0.1. I'll go back to my Perspective View and Render, so we can see it's very clear that these shadows are based upon pixels. So, if I want to get a sharper result, I will need to increase the Size or Resolution. Just by way of example, if I've reduced the Size down to something really low, like 64, we are going to get useless shadows.
This is almost like some sort of 8-bit game now at this point. The Size works best if it's at a power of 2 value, such as 256, or 512, or 1024. So, with a value of 1024 we are starting to get crisper shadows. If I bring this Sample Range back up to let's say 2, then it's starting to soften up. But it still never going to be quite good enough until I increased this Size up to something much greater.
Now, this is dependent upon my view as well. So, if I render this in the Camera View with the camera farther away, we might not notice those jaggies quite as much. So, let's Render the Camera View instead. So, we are still seeing a little bit of jagged edges there. So, I might increase the Size up to 2048. Be aware that as you increase that value, you are using more and more memory in your computer.
So, the highest I ever take this up is to probably about a 4K resolution, or 4096. If I need to take it up higher than that, then I'll just actually switch over to Ray Traced Shadows. So, that's okay. Maybe, I can increase the Sample Range up to 4. That's about as crisp as I can expect it to ever be using Shadow Maps. Finally, the distance of the light and the Falloff angle are going to have an impact on the final result here.
So, remember that this resolution is being stretched across the Faloff angle. So, if I have a greater Faloff, that's going to end up producing less accurate shadows. So, I'll go back to my Rendered Frame window. I'll Clone it out so we can see the difference. I'll just Render Camera001 again. So, if you look closely you can see that this is a bit softer, and this is a bit sharper.
All I did was increase the Falloff radius. I'll do this again with a lower Size to make it more dramatic, let's say a Size of 512. So, with a wide-angle here, we get a pretty soft and mushy shadow. I'll clone that, and I'll reduce my Falloff angle down, go back to my Rendered frame views and re-render with a narrower angle.
So, the only difference between these two is the Falloff radius angle. So, the distance of the light also has an impact. So, if I move the light back in my scene, it's going to cause the shadow to spread out over a larger area, resulting in less accurate, or more aliased shadows. So, all those things interact with one another. The distance of the light, the angle of the Falloff, the Size and the Sample Range all contribute to the end result here. I found that the default value of 512 is usually never good enough.
So, at the minimum, I'll always increase this up to a Value of 1024. Sample Range, I might increase if I want a softer look and having adjusted those values, now, I think I am getting a pretty good result. That just a little bit about how to optimize your Shadow Map values.
Get unlimited access to all courses for just $25/month.Become a member
107 Video lessons · 35441 Viewers
100 Video lessons · 5906 Viewers
94 Video lessons · 24792 Viewers
83 Video lessons · 10411 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.