How to use Anti-Aliasing in 360/ 180 Degree Renders in Unreal Engine with Lumen

How to get the best quality 360 and 180 Degree renders from Unreal Engine using anti-aliasing

Last updated About 7 hours ago

This guide is about using anti-aliasing with Lumen and DirectX12 graphics. If you are using Path-Tracing see the separate guide.


Unreal continues to improve it’s anti-aliasing output in each new Engine release, so for the best results, use the latest Unreal Engine version.

Overview

Anti-aliasing cleans up edges and reflections that would otherwise look unnaturally crisp or jagged.

It works by taking samples from parts of the pixel, or from previous/ future frames, and using those samples to smooth out colors and details (either within a frame or between multiple frames).

It needs reference frames to work effectively, so you need to add warm-up frames by extending your camera cut to add frames before your render sequence begins (see below).

Getting the best image results may require trying different anti-aliasing approaches such as using TSR, DLAA or None, changing your warm-ups and adding temporal and spatial samples. This guide will show you how.

Temporal and Spatial Samples

There are two types of samples used to control anti-aliasing:

  • Temporal Samples: Are taken across multiple frames which helps smooth out moving objects or effects caused by moving cameras.

  • Spatial Samples: Are taken around the area of a pixel to determine the best average of colors with the goal of smoothing transitions between the colors to stop jagged lines.

Epic says you only have two reasons to increase temporal or spatial samples in Movie Render Queue: (more detail below).

  1. If you see bad quality in your motion blur, you should increase temporal samples

  2. If you see bad anti-aliasing that isn't motion blur you should increase spatial samples, in which case you should set AntiAliasing to None .

TSR

Unreal Engine has a variety of anti-aliasing methods each of which have different benefits.

  • TSR (Temporal Super Resolution) is the default anti-aliasing method you should start with in Movie Render Queue.

  • It normally will be enabled by default in your Project Settings so you only need to modify it in Movie Render Queue if you want to add additional samples (as explained below).

  • As Epic recommends"you should only disable this [TSR] in MRQ [Movie Render Queue] if there is a visual reason to do so, there are a large number of rendering features that work best... and require TSR like Lumen. "

DLAA

  • Deep Learning Anti-Aliasing (DLAA) is a system developed by NVIDIA which uses a variety of ai trained algorithmic methods to improve the anti-aliasing in your renders.

  • You can try it as an alternative to TSR as it can offer better visual results and reduce the shimmering that TSR can sometimes create.

  • DLAA can be used with both spatial and temporal samples as explained below.

  • To do so, download the DLSS plugin from this link and add to your Project or Engine plugins folder, then in Movie Render Queue add the DLSS/ DLAA section and select DLAA:

Super Sampling

Super-sampling is the method of rendering at a higher resolution than your target output to give your anti-aliasing algorithm more sample pixels to select from.

This can be a very effective way to increase detail and clarity in your renders and sometimes can be faster to render than increasing anti-aliasing samples:

  • Ensure that TSR is selected as your anti-aliasing method (this will not work with DLAA):

  • Add a r.screenpercentage Console Variable of >100% to your Movie Render Queue settings.

    • The higher the number, the more detail you will get but the longer your render time (too high and you will need to use tiling to prevent VRAM crashes):

Upsampling

Upsampling/ upscaling is an anti-aliasing method that lets you increase performance by using AI upscaling to render a % of the pixels in your output.

  • Unreal offers upscaling via its TSR anti-aliasing method, which works with NVIDIA and non-NVIDIA GPUs; or

  • You can use NVIDIA’s DLSS system, which can provide better performance on NVIDIA GPUs.

TSR

  1. Select Temporal Super Resolution (TSR) either in your Project Settings or in your Movie Render Queue Anti-Aliasing settings (Lumen renders only).

  2. Use a Console Variable to change your screen percentage to <100% (You should try 90%, 75% etc and check if you are happy with the visual quality vs. the faster render time):

DLSS

  • Download the DLSS plugin from this link and add to your Project or Engine plugins folder, then in Movie Render Queue add the DLSS/ DLAA section and select DLAA:

  • Select any of the other DLSS Quality options (in the drop-down below):

  • DLSS will automatically change your screen percentage settings as follows:(Ultra Quality: 77%,Quality: 66.7%,Balanced: 58%,Performance: 50.0%,Ultra Performance: 33.3% ):

Detailed Guidance

Summary Tips

  • Start with TSR enabled and only increase anti-aliasing samples if you have one of these issues:

    • If you are rendering a static shot and TSR still causes jagged edges, set anti-aliasing to None and add spatial samples.

    • In a moving shot, if you need more clarity in your motion blur, keep TSR on (or use DLAA) and add temporal samples (>11 is unlikely to be worthwhile).

    • In a moving shot, if you need to clean up jagged edges, set anti-aliasing to None and start with 1 spatial sample and 3 temporal samples. Add more in single increments until your issue is fixed.

  • You can try DLAA as an alternative to TSR, as it may fix your issue without having to increase anti-aliasing samples.

  • If you are unhappy about image crispness, use TSR and add console variable r.ScreenPercentage with value >125. Rendering more pixels like this may be faster than adding more anti-aliasing samples to get the same visual impact.

  • Check the light or post-process volume settings for Lumen, shadows, reflections, refractions, ambient occlusion, global illumination like samples per pixel or quality as these can solve issues without having to increase anti-aliasing samples (faster render times).

  • Always use excess frames in your Camera Cut as a warm-up, so Lumen, physics effects and particles can settle correctly.

  • Delete all console variables apart from Flush Grass Streaming, unless you have a reason for them being there.

  • Check recommended console variables below for motion blur and occlusion.

  • For a full explanation see the sections below.

Anti-Aliasing

  • By default, your Movie Render Queue anti-aliasing will follow your Project Settings which, Unreal sets to TSR as standard:

  • If you want to modifyanti-aliasing, then you need to add the section in Movie Render Queue settings where you can control individual values and override your Project Settings:

    • Spatial Sample Count: Use this to set a value for the number of spatial samples that your anti-aliasing method will take (more info below).

    • Temporal Sample Count: Use this to set a value for the number of temporal samples that your anti-aliasing method will take (more info below).

    • Override Anti Aliasing: This overrides your Project Settings, by selecting a new anti-aliasing method.

      • In general, TSR is recommended as a default and None is only recommended if you want to increase spatial samples (see below).

    • Use Camera Cut for Warm Up: This is an extremely important setting which makes Movie Render Queue process real frames from your 360 camera/ component before starting your render.

      • This ensures things like motion vectors are being calculated before your render begins, which is essential for the accurate rendering of moving objects or physics based elements like hair/ cloth/ particles.

      • For how many frames to add in your camera cut before your render begins, see the guide below.

      • If this option is unticked and/or you have no excess frames in your camera cut then your render won’t have any frames from your camera frustrum to create physics data or temporal samples from, resulting in poor visual output.

    • Render Warm Up Frames: This should normally be ticked in addition to Use Camera Cut for Warm Up because it ensures that the warm up frames in your camera cut are actually rendered (and then discarded rather than being saved to file).

      • Certain systems, like GPU particles, need to be rendered to perform their warm up effectively.

      • If this option is unticked then even if you have a long camera cut to use for your warm up frames, your renders might still be poor visual quality.

    • Advanced: This is an alternative, less effective, approach than Use Camera Cut for Warm Up. It is not recommended.

      • Instead, what you do is input a number of frames to warm-up in the boxes below.

      • It is less effective than using your camera cut because it doesn’t reference to any actual prior frames than the one you are about to render (because the engine doesn’t have a camera frustrum to work from so doesn’t know what those frames would be).

      • It just iterates between frames 0 and 1 for however many counts you set in the value below to build up sample data.

      • For this reason, this method is likely to result in poor visual quality unless you have a static camera, no moving objects and no physics based elements.

    • Render Warm Up Count: This sets the number of GPU cycles which your warm-up will run through before you start your render.

      • If you are have ticked Use Camera Cut for Warm Up, you can normally leave this at 0 (because your camera cut will be used instead).

    • Engine Warn Up Count: This sets the number of CPU cycles which your warm-up will run through before you start your render.

      • If you are have ticked Use Camera Cut for Warm Up, you can normally leave this at 0 (because your camera cut will be used instead).

DLAA

  • Deep Learning Anti-Aliasing (DLAA) is a system developed by NVIDIA which uses a variety of AI trained algorithmic methods to improve the anti-aliasing in your renders.

  • NVIDIA has very sophisticated algorithms which can distiguish between noise and detail and so offer a higher quality of lighting effects and reduce blurring.

  • You can use DLAA as an alternative to TSR by downloading and enabling the plugin and then adding it as a setting in Movie Render Queue (it will automatically replace whatever anti-aliasing method you have set):

  • You should still use the anti-aliasing settings in Movie Render Queue for your warm-ups and to add temporal and spatial samples (as explained above).

Other Important Settings

Unless you have a specific requirement, adding more anti-aliasing samples will just increase your render times for nothing! 

Try changing the settings below before adding anti-aliasing samples (you can also try the console variables below):

Shadows

  • "If you see chattering in the shadows consider raising the Samples Per Pixel on the lights.

  • If you have any softness to your shadow at all you’ll want to consider raising it above 1. Especially for Area Lights:"

Reflections

  • "If you see noise in the reflections then try modifying the settings in the Post Process Volume... They all have their own Samples/Quality:"

Refractions, Global Illumination, Ambient Occlusion

  • "If you see noise in your Refractions, Global Illumination, or Ambient Occlusion, that needs to be addressed in the Post Process Volume, not Movie Render Queue."

  • Address this by modifying the samples/ quality of these elements in your Post Process Volume settings:

Motion Blur

  • In Movie Render Queue, add the Console Variable r.MotionBlurSeparable and set the value to 1 .

  • This will smooth out Motion Blur in a second dedicated render pass without requiring a full render:

Occlusion

  • If objects are popping into view, this may be due to occlusion settings, which are optimised for real-time playback and so not necessary in renders.

  • Adding the console variable r.AllowocclusionQueries with value 0 can fix this:

Image Crispness

  • If you can’t get the level of detail you want in certain areas, then increasing the number of pixels that your anti-aliasing method can choose from, via high resolution downscaling can help with this.

  • Ensure TSR is selected and then add console variable r.ScreenPercentage with value >125 to render each face at 125% of your set resolution.

  • This will increase your render times but it can be faster than adding the anti-aliasing samples you would need to get the same visual quality:

Warm-Ups

Warm-ups are essential for getting a high quality render, especially if you have moving images, complex lighting or physics based effects:

Using Camera Cut as Warm-Up

  • You should add a number of frames to your camera cut in Sequencer before the frame where you want your render to start.

  • You should then enable Use Camera Cut for Warm Up in your Movie Render Queue anti-aliasing settings so you use the camera cut frames for your warm-up.

  • Using camera cut frames for your warm up is important for two reasons:

    • It means the engine is processing real frames, which is essential for accurate rendering of moving objects or physics based items like hair/ cloth/ particles.

    • Your warm up will use the frustrum of your camera to create samples so motion based effects will be rendered much more accurately.

  • If you are using any GPU based physics effects you need to also tick Render Warm Up Frames, which means the engine will actually render and then discard the warm-up frames to ensure those elements run correctly when your render begins.

How Many Warm Up Frames to Use

  • Your warm-up frame count needs to be at least as long as the number of temporal samples you have set, but likely longer:

    • You need at least the same frames as your temporal samples because otherwise the engine won’t be able to sample from real frames for motion effects etc.

  • Ideally you should have more frames because different Unreal processes need more to generate data to work effectively:

    • Lumen needs >32 frames to find and stabilise bounce lighting.

    • Cinematic shots likely need >64 frames to ensure correct motion effects etc.

    • If you have complex particle effects or physics then you likely need >128 frames to let the effects settle.

  • If you are using animations, particles etc you need to extend animation, transform, particle activation tracks etc into your warm-up frames in Sequencer, otherwise those effects won’t be active during your warm-up frames and so won’t be correct when your render starts.

    • To previz this, use the Evaluate Sub-Sequence in Isolation option in your Sequencer toolbar:

  • The number of frames you need will also depend on your frame rate, with a larger number required for higher FPS output.

    • For example, if you are rendering at 30FPS and it takes two seconds for a cloth effect to settle then you need >60 frames for your warm-up.

    • But if you render the same shot at 60FPS then you will need to double your warm-up frames to >120.

  • You can see more guidance from Epic here.

Temporal Samples

When to Increase Temporal Samples

  • If you see bad quality in your motion blur, you should increase temporal samples

  • For fast-moving scenes you will need a larger amount of temporal samples but increasing them above 8 will have a big effect on your render time.

How to Increase Temporal Samples

  1. Use Temporal Super Resolution (TSR) as your anti-aliasing method when you increase temporal samples.

  2. Increase temporal samples without increasing spatial samples"There isn’t any advantage to mixing temporal and spatial samples. Do not mix and match."

    1. Increase temporal samples if you don't see smooth motion blur: "Faster moving shots will need more Temporal Samples than slow ones."

    2. Use odd numbers (3, 5, 7, 9, 11) for your temporal sample count: "it's best to keep your sampling to odd numbers so that you get a sample on the keyframe for any animated impact or change or direction".

    3. Don’t increase temporal samples above 12: "anything past 12ish is not really visibly seen... you get diminishing returns and should consider setting the AA method to None."

Spatial Samples

When to Increase Spatial Samples

Epic recommends to increase spatial samples only as a last resort when all the following criteria are met:

  1. You are rendering a moving image and have to increase your temporal sample count above 12.

  2. You are rendering a static image without temporal samples and with TSR on, you still are still getting jagged edges or flickering.

  3. You have tried changing the other settings for Shadows, Reflections and Global Illumination (above).

For example:

  • "If you had a really hot, thin piece of geometry and it's really hard to get the outline clean.

  • Or a bunch of think lines stacking up on one another going back in Z-axis from the camera.

  • These are hard problems to handle and you might have to count on spatial/temporal samples to clean up the line."

How to Increase Spatial Samples

In that case, you will bypass using a predictive anti-aliasing algorithm and brute force generating the pixels by taking lots of samples and then rendering them together:

  1. Tick Override Anti Aliasing and set AntiAliasing Method to None.

  2. If you are rendering a static image, then you don’t need to add temporal samples, so just add spatial samples until you have the image you need.

  3. If you are rendering a moving image, set spatial samples and temporal samples in incremental amounts, running test frame renders to see if it solves your issue.

  4. Remember that spatial and temporal samples are multiplied:

    1. At each temporal sample, the engine will take your full spatial sample count.

    2. For example, if you set 13 temporal samples and 8 spatial samples, you will render 8 spatial samples at 13 temporal positions = 104 total samples for every frame!

    3. That will result in long render times.

  5. For that reason, as little as 1 spatial sample and 3 temporal samples can potentially achieve an image as clean as TSR.

  6. You should think about your visual issue:

    1. If it is from motion, such as incorrect motion blur, then you should add more temporal samples than spatial samples.

    2. If it is a piece of geometry with jagged edges, then you should should start with the minimum effective temporal samples and add spatial samples until the issue is resolved.

  7. However, for complex geometries as mentioned above, you are likely to need more samples to get the visual quality you needs.

Console Variables

Console Variables (CVars) aren’t directly related to anti-aliasing but they do affect your renders and so they should be checked if you are having issues:

  • Remove all Console Variable overrides unless you have a specific reason you are including them.

  • If you see any large low-frequency noise, that's from Denoisers. You have to find the right Denoiser (Ambient Occlusion, Global Illumination, Reflections, etc.) and shut it off.

  • If you disable all the options in the Game Overrides section, aside from Flush Grass Streaming, that will get you as close as possible to what you are seeing in the Editor Viewport (assuming you don’t have any CVar overrides in Movie Render Queue).

  • The geometry LOD settings here will not override anything Nanite. They are only for non-nanite actors.