临时抗锯齿(TAA)
Temporal anti-aliasing (also known as TAA) is a anti-aliasing technique to reduce temporal aliasing (flickering or shimmering effects). This technique can be combined with FXAA for better quality. 临时抗锯齿(也称为 TAA )是一种抗锯齿技术,可以减少临时锯齿(闪烁或闪烁效果)。可以将此技术与 FXAA 结合使用以获得更好的质量。
ISS without TAA.没有TAA的ISS。
|
ISS with TAA.带有TAA的ISS。
|
TAA FeaturesTAA功能#
Unlike Multisample anti-aliasing (MSAA) that performs anti-aliasing only on edges of polygons (and makes this edges smoother), Temporal anti-aliasing applies smoothing to the whole scene. In case of full deferred rendering (when the final image is composed of different texture buffers: depth, normal, etc.), MSAA will increase performance costs, because Multisample anti-aliasing should be applied to each texture buffer.与仅在多边形的边缘上执行抗锯齿处理(并使该边缘更平滑)的 Multisample anti-aliasing (MSAA)不同,时间抗锯齿处理将平滑应用于整个场景。如果完全延迟渲染(最终图像由不同的纹理缓冲区(深度,法线等)组成),则MSAA将增加性能成本,因为应将Multisample抗锯齿应用于每个纹理缓冲区。
How TAA worksTAA如何运作#
The main concept of temporal anti-aliasing is to use a subpixel jitter of scene camera every frame and then combine all this frames into the final image. So, it will take time to get a smoothed picture (for example, 5-7 frames), but with the frequency of 60 frames per second it will look seamlessly.时间抗锯齿的主要概念是每帧使用场景相机的子像素抖动,然后将所有这些帧组合为最终图像。因此,要花一些时间才能获得平滑的图片(例如5-7帧),但是以每秒60帧的频率,它将看起来是无缝的。
During rasterization process, there is a test whether the object will get into pixel or not. And the object will not be rendered if it doesn't occupy a major part of a pixel.在栅格化过程中,将测试对象是否会进入像素。如果对象不占据像素的主要部分,则不会渲染该对象。
And here we can get an error, when we have a sphere object before rasterization and get a square object after, because some parts of the sphere doesn't occupy enough pixel space.在这里,当我们在光栅化之前有一个球体对象而在栅格化之后得到一个方形对象时,我们会得到一个错误,因为球体的某些部分没有占据足够的像素空间。
Not a very good rendering, right? And temporal anti-aliasing solves this problem, because camera will have a subpixel jitter, and each part of this sphere at least once will be rendered in a frame. And after combining these frames, we will get a true sphere, not a square! Voila!效果不是很好,对吧?时域抗锯齿解决了这个问题,因为相机会出现亚像素抖动,并且该球体的每个部分至少会在一个帧中渲染一次。合并这些框架后,我们将得到一个真正的球体,而不是正方形!瞧!
Ghosting重影#
This anti-aliasing technique works perfectly for static scenes (without any moving objects). But when objects are moving, frames will significantly differ one from another and we will see a trail of "ghosts" of the moving object. This effect is called ghosting.这种抗锯齿技术非常适合静态场景(没有任何移动物体)。但是,当物体移动时,框架会彼此明显不同,我们将看到运动物体的“重影”痕迹。这种效果称为 ghosting 。
To get rid of ghosting, there is a velocity buffer. Velocity buffer stores information about transformations of objects. Due to this buffer, the engine knows about the object transformation and don't render the "ghosts" of the moving object. Also, the engine checks the color intensity of the pixel, because of camera jitter.为了消除重影,有一个速度缓冲器。速度缓冲区存储有关对象转换的信息。由于有了这个缓冲区,引擎知道对象的变换,并且不渲染移动对象的“鬼影”。此外,由于相机抖动,引擎还会检查像素的颜色强度。
Summary概要#
TAA has a wide scope of usage, because it improves whole image (not only the edges of the geometry, like MSAA) including geometry, shadows, etc. It greatly reduces all the problems, and does not cut the performance down, working well with both static and dynamic images. However, keep in mind that the key factor of good TAA performance is optimized content of the scene: the higher FPS is, the faster temporal anti-aliasing smooths the scene. In addition to this, UNIGINE allows you to choose the type of anti-aliasing: TAA or FXAA, or combine them both for better image quality (FXAA is applied before temporal summing). TAA的使用范围很广,因为它可以改善整个图像(不仅是几何图形的边缘,例如MSAA),包括几何图形,阴影等。它可以大大减少所有问题,并且不会降低性能,与静态和动态图像均能很好地工作。但是,请记住,良好的TAA性能的关键因素是场景的优化内容:FPS越高,临时的抗锯齿效果使场景平滑的速度就越快。除此之外,UNIGINE允许您选择抗锯齿的类型: TAA 或 FXAA ,或将两者组合使用以获得更好的图像质量(在时间求和之前应用FXAA。)
TAA AdjustmentTAA调整#
Temporal Anti-Aliasing (TAA) settings are available for adjustment via the Render -> Antialiasing section of the Settings window, along with SRAA, Fast approXimate Anti-Aliasing (FXAA) and Supersampling settings. The following settings are available when the Custom preset for Anti-Aliasing is selected.临时抗锯齿(TAA)设置可通过Settings窗口的Render -> Antialiasing部分以及快速近似抗锯齿(FXAA)和 Supersampling 进行调整设置。
日期设定#
TAA | Toggles TAA on and off.启用和禁用TAA。 |
---|---|
Fix Flicker | Removes bright pixels by using the pixel brightness information from the previous frame. We recommend to enable this option for bright thin ropes, wires, and lines. However, when enabled, may produce artifacts by removing small bright objects.
Can be controlled by render_taa_fix_flicker console command.Can be controlled by render_taa_fix_flicker console command. Can be controlled by render_taa_fix_flicker console command.可以由 render_taa_fix_flicker 控制台命令控制。 |
Frames By Color | Toggles accumulation of a variable number of frames over time depending on the pixel color difference between the current and previous frames on and off. If the pixel color in the current frame differs from the pixel color of the previous frame a lot, these frames aren't combined and blended during TAA. When enabled the image becomes more sharp but it may produce additional flickering, thin objects may be blurred (e.g. grass, metal structures, wires, etc.).
Disabling this option may result in more noticeable ghosting effect.
Can be controlled by render_taa_frames_by_color
console command.Can be controlled by render_taa_frames_by_color
console command. Can be controlled by render_taa_frames_by_color
console command.可以通过 render_taa_frames_by_color
控制台命令进行控制。 |
Fix Blur | Toggles Catmull-Rom resampling on and off. The option allows you to reduce image blurring when the camera moves forward/backward resulting in a sharper image. It is recommended to disable resampling at low settings.
Can be controlled by render_taa_catmull_resampling console command.Can be controlled by render_taa_catmull_resampling console command. Can be controlled by render_taa_catmull_resampling console command.可以通过 render_taa_catmull_resampling 控制台命令进行控制。 |
Antialiasing In Motion | Toggles improved anti-aliasing in motion (for moving camera and objects) on and off.
Can be controlled by render_taa_antialiasing_in_motion console command.Can be controlled by render_taa_antialiasing_in_motion console command. Can be controlled by render_taa_antialiasing_in_motion console command.可以通过 render_taa_antialiasing_in_motion 控制台命令进行控制。 |
Diagonal Neighbors | Toggles taking into account diagonally neighboring pixels in the process of color clamping on and off. 在啟用和禁用顏色箝位的過程中考慮對角線相鄰的像素進行切換。 |
Preserve Details | Controls the TAA detail level: the higher the value, the more detailed the image is. At the value of 0, the image becomes blurred when moving the camera, however, the TAA effect is better. At high values, this option may produce additional flickering. Thus, to improve the anti-aliasing effect, you can decrease the value; to minimize blurring — increase it.
Can be controlled by render_taa_preserve_details console command.Can be controlled by render_taa_preserve_details console command. Can be controlled by render_taa_preserve_details console command.可以通过 render_taa_preserve_details 控制台命令进行控制。 |
Frame Count | Specifies the number of frames that are combined and blended during TAA calculation. The higher the value, the more frames are combined into the final image and the better anti-aliasing is.
|
Pixel Offset | Specifies the size of the sample offset performed during subpixel jittering. This parameter allows specifying the offset that is less than a pixel: for example, if you specify 0.5, frames will shift to half a pixel. The parameter allows reducing flickering of small elements on the screen.
Can be controlled by render_taa_pixel_offset console command.Can be controlled by render_taa_pixel_offset console command. Can be controlled by render_taa_pixel_offset console command.可以通过 render_taa_pixel_offset 控制台命令进行控制。 |
TAA Samples | Specifies the number of the sample offsets performed during subpixel jittering. By the minimum value of 1, there are no offsets and, therefore, no anti-aliasing. The parameter allows reducing image jittering and blurring. Available values are 1, 4, 8, and 16.
Can be controlled by render_taa_samples console command.Can be controlled by render_taa_samples console command. Can be controlled by render_taa_samples console command.可以通过 render_taa_samples 控制台命令进行控制。 |
速度帧
Enabled | Toggles accumulaton of a variable number of frames over time depending on the pixel velocity difference between the current and previous frames on and off. Reprojection of pixels of the previous frame is performed taking into account the velocity buffer and the result is combined with pixels of the current frame.
This option reduces blurring and ghosting in dynamic scenes with a lot of moving objects.
Can be controlled by render_taa_frames_by_velocity
console command.Can be controlled by render_taa_frames_by_velocity
console command. Can be controlled by render_taa_frames_by_velocity
console command.可以通过 render_taa_frames_by_velocity
控制台命令进行控制。 |
---|---|
Threshold | Specifies the threshold value defining sensitivity to velocity change (velocity threshold at which pixels are treated as fast moving).
Can be controlled by render_taa_frames_velocity_threshold console command.Can be controlled by render_taa_frames_velocity_threshold console command. Can be controlled by render_taa_frames_velocity_threshold console command.可以通过 render_taa_frames_velocity_threshold 控制台命令进行控制。 |
Max Frame Count | Sets the number of frames combined and blended for pixels that don't move relative to the screen space.
Can be controlled by render_taa_max_frames_by_velocity console command.Can be controlled by render_taa_max_frames_by_velocity console command. Can be controlled by render_taa_max_frames_by_velocity console command.可以通过 render_taa_max_frames_by_velocity 控制台命令进行控制。 |
Min Frame Count | Sets the number of frames combined and blended for fast moving pixels on the screen.
Can be controlled by render_taa_min_frames_by_velocity console command.Can be controlled by render_taa_min_frames_by_velocity console command. Can be controlled by render_taa_min_frames_by_velocity console command.可以通过 render_taa_min_frames_by_velocity 控制台命令进行控制。 |
Recommendations推荐建议#
As you can see TAA has a lot of settings enabling you to adjust it for relatively static scenes as well as for dynamically changing environments.如您所见,TAA具有许多设置,使您可以针对相对静态的场景以及动态变化的环境进行调整。
Static Scenes静态场景#
Below is an example of TAA settings for relatively static scenes.下面是相对静态场景的TAA设置示例。
- The Diagonal Neighbors option should be enabled, as it provides more accurate pixel color information reducing the stair-step effect. At the same time TAA causes more blurring is case of fast camera movement, which is especially noticeable on grass and other similar high-contrast screen areas.应该启用Diagonal Neighbors选项,因为它提供了更准确的像素颜色信息,从而减少了阶梯效应。同时,在快速移动相机的情况下,TAA会导致更多的模糊,在草地和其他类似高对比度屏幕区域上尤其明显。
- Preserve Detail value is decreased to reduce flickering of small pixels.降低Preserve Detail值以减少小像素的闪烁。
- The number of TAA Samples is set to 16, which increases the number of variants for subpixel camera jittering, thus making the stair-step effect even less noticeable. TAA样本的数量设置为 16 ,这会增加子像素相机抖动的变化数量,从而使阶梯效果更加不明显。
Dynamic Scenes动态场景#
Below is an example of TAA settings for very dynamic scenes where trails from thin objects are especially noticeable.以下是非常动态的场景中TAA设置的示例,在这种场景中,薄物体的踪迹特别明显。
- The Diagonal Neighbors option should be turned off, as it may result in significant blurring of small details in motion.应该关闭Diagonal Neighbors选项,因为它可能导致运动中的小细节明显模糊。
- Increase the Preserve Details value up to 1 or higher to reduce ghosting effect for moving objects.将Preserve Details值提高到 1 或更高,以减少移动对象的重影效果。
- Set TAA Samples value to 4 to reduce flickering of small pixels when the camera does not move.将TAA Samples值设置为 4 ,以减少相机不移动时小像素的闪烁。
- It is also recommended to reduce Max Frame Count to 60 or lower, to accumulate less frames for slow motion, reducing the ghosting effect.还建议将Max Frame Count降低到 60 或更低,以减少帧累积以进行慢动作,从而减少重影效果。