Version: Unity 6 (6000.0)
Language : English
Configure settings with the URP Config package
Custom rendering and post-processing in URP

Add anti-aliasing in the Universal Render Pipeline

Aliasing is a side effect that happens when a digital sampler samples real-world information and attempts to digitize it. For example, when you sample audio or video, aliasing means that the shape of the digital signal doesn’t match the shape of the original signal. This means when Unity renders a line, it may appear jagged as the pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
don’t align perfectly with the line’s intended path across the screen.

An example of the rasterization process creating some aliasing.
An example of the rasterization process creating aliasing.

To prevent aliasing, the Universal Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
(URP) has multiple methods of anti-aliasing, each with their own effectiveness and resource intensity.

The anti-aliasing methods available are:

Fast Approximate Anti-aliasing (FXAA)

FXAA uses a full screen pass that smooths edges on a per-pixel level. This is the least resource intensive anti-aliasing technique in URP.

To select FXAA for a CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
:

  1. Select the Camera in the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    view or Hierarchy window and view it in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    .
  2. Navigate to Rendering > Anti-aliasing, and select Fast Approximate Anti-aliasing (FXAA).

Note: For anti-aliasing on mobile platforms, Unity recommends that you use FXAA.

Subpixel Morphological Anti-aliasing (SMAA)

SMAA finds patterns in the borders of an image and blends the pixels on these borders according to the pattern it finds. This anti-aliasing method has much sharper results than FXAA.

To select SMAA for a Camera:

  1. Select the Camera in the Scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
    See in Glossary
    or Hierarchy window and view it in the Inspector.
  2. Navigate to Rendering > Anti-aliasing, and select Subpixel Morphological Anti-aliasing (SMAA).

Temporal Anti-aliasing (TAA)

TAA uses frames from a color history buffer to smooth edges over the course of multiple frames. Because TAA calculates its effects over time, it often creates ghosting artifacts in extreme situations, such as when a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
moves quickly in front of a surface that contrasts with it. TAA uses motion vectors.

To select TAA for a Camera:

  1. Select the Camera in the Scene view or Hierarchy window and view it in the Inspector.
  2. Navigate to Rendering > Anti-aliasing, and select Temporal Anti-aliasing (TAA).

The following features cannot be used with TAA:

Multisample Anti-aliasing (MSAA)

MSAA samples the depth and stencil values of every pixel and combines these samples to produce the final pixel. Crucially, MSAA solves spatial aliasing issues and is better at solving triangle-edge aliasing issues than the other techniques. However, it does not fix shaderA program that runs on the GPU. More info
See in Glossary
aliasing issues such as specular or texture aliasing.

MSAA is more resource intensive than other forms of anti-aliasing on most hardware. However, when run on a tiled GPU with no post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary
anti-aliasing or custom render features in use, MSAA is a cheaper option than other anti-aliasing types.

MSAA is a hardware anti-aliasing method. This means you can use it with the other methods, as they are post-processing effects. However, you can’t use MSAA with TAA.

To enable MSAA:

  1. Open a URP Asset in the Inspector.
  2. Navigate to Quality > Anti Aliasing (MSAA) and select the level of MSAA you want.

For more information on the available settings, refer to the MSAA setings in the URP Asset.

Note: On mobile platforms that don’t support the StoreAndResolve store action, if Opaque Texture is selected in the URP Asset, Unity ignores the MSAA property at runtime (as if MSAA is set to Disabled).

Configure settings with the URP Config package
Custom rendering and post-processing in URP
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961