Let's start this recipe by looking through the camera's lens. This is something we have usually done throughout the current chapter, and we've always done that with the hope that certain effects that we are going to use will be better visualized if they are seen from that particular camera location. This is still the case in the current recipe, since we are going to explore screen space reflections and we need to make sure that they are visible. With that said, this is the image we should be seeing once we are looking through the camera:
Having that image as a reference will let us check many of the post processing effects we are about to introduce. Let's start with the first one—choosing the default Anti Aliasing method:
Head over to Edit | Project Settings. In there, navigate to the Rendering section under the Engine category. Once inside, scroll even further down to the panel called Default Settings and look for the anti-aliasing method. Make sure that it's set to Temporal AA, which should be by default. You can keep that value throughout the rest of this recipe, or try to change it if you want to see a difference. We'll be exploring this further in the How it works... section, but we need to have something at this point for the next steps to happen:
Even though the anti-aliasing option used to be part of the post process volume actor in past iterations of the engine, they've changed it's location to the one mentioned previously.
The quality of the anti aliasing can be controlled via console commands, both in game and in the editor.
Open up the command console by tapping the tilde key in your keyboard. Type r.PostProcessAAQuality 6 to set the quality of the temporal anti aliasing to the maximum the Unreal will allow you to. Feel free to set it up to anything between 0 and 6, which is the range said command is expecting:
If you can't bring up the console command or if you are using a different keyboard layout other than the English (UK) one, rest assured that you can set a custom key binding to bring it up. Head over to Project Settings | Engine | Input | Console to change the default value.
Another command you can use to quickly change between the different anti aliasing methods is r.DefaultFeature.AntiAliasing. Following that command with a value of 0, 1 or 2 will toggle between no effect, FXAA or TAA:
As you can see from the preceding screenshot, the difference in the quality of the AA method is really visible if we go from zero to two, or from two to four. Going as high as six doesn't seem to be doing much in our particular scene, but could be useful when heavy aliasing happens in thin objects such as cables. Next up, we are going to be looking at the screen space reflections. With the post process volume selected, head over to the Details panel and scroll down to the Rendering Featuressettings.
Expand the Screen Space Reflections section and tick theQuality checkbox. By default this should be set to 50 increase it to 100 instead.
While in here, do tick as well the parameter called Max Roughness. Its default value of 0.6 might be a bit low for many cases, so let's raise it to 0.8:
We'll explore in further detail what those parameters are affecting in the There's more... section, but this setting basically increases the quality of the screen space reflections effect. These can be quite important in some scenes, in particular in those where we have dynamic objects moving around which can cause reflections to update in real time. They are limited in that they can only reflect what is on the screen, so things that are behind the camera or at the very edges of the image won't be picked up. Another rendering feature we can include is the Ambient Occlusion. It works on a post process layer by analyzing the scene and determining which areas should be darker according to how occluded they are.
Expand the Ambient Occlusion section and tick the Intensitycheckbox, as well as the Radius one. Give the first parameter a value of 0.3 and go with 10 for the second one.
Expand theAdvanced section while still within the Ambient Occlusion tab. Check the two tick-boxes where it says Radius in WorldSpace. By doing this, we are ensuring that the value of 10 we have previously specified means 10 centimeters in world space units:
If we set the property Radius in WorldSpace to true, the Radius we specify takes into account that distance to create the Ambient Occlusion effect. Leaving it on the default false state means that the calculations for the AO happen taking into account the default view space, which is locked to 400 units.
The last setting that we are going to talk about is the Screen Percentage. This setting can be found under the Misc section of theRendering Features category. What we basically control through it is what you might know as Supersampling; let's try it out.
Check the Screen Percentage checkbox and increase the default value of 100 to something like 200. Be careful thoughthis has a great impact on performance and you should be careful when choosing a number in this box. You can read more about this in the next section, How it works...
In order to test this setting we actually need to play the game. As it is a runtime effect, we can't visualize its impact on the main viewport of the Unreal editor; instead, click on the Play button at the top of the main Toolbar:
Before we go, I'd like to leave you with some images from this scene taken under different Screen Percentagesettings. They should be representative of the changes in image quality that Supersampling introduces or upscaling, which is the term used when the screen percentage is lower than 100: