Sampling & anti-aliasing采样与抗锯齿
Lessons 04–05 sampled coverage and textures at one point per pixel — the pixel's center. That point is a lie. A pixel is a little area of the sensor, and asking a single point "are you inside the triangle?" throws away everything else happening under that pixel. Point-sample a sharp edge and you get staircase jaggies; point-sample a fine texture and you get moiré and crawling shimmer. This lesson names the disease — aliasing, the exact phenomenon the CV track met under Nyquist — and walks the ladder of fixes the whole industry climbed: supersampling, MSAA, post-process AA, and temporal AA. 第 04–05 课在每像素一个点——像素中心——处采样覆盖率与纹理。这个点是个谎言。像素是传感器上一小块面积,只拿一个点去问“你在三角形里吗?”,就把这个像素下发生的其余一切都丢掉了。对一条锐利边缘做点采样,你得到阶梯状的锯齿;对精细纹理做点采样,你得到摩尔纹与蠕动的闪烁。这一课点出这个病名——走样,正是 CV 课里在奈奎斯特(Nyquist)之下遇到的那个现象——并沿着整个业界爬过的那道修复阶梯往上走:超采样、MSAA、后处理抗锯齿,以及时域抗锯齿。
Five moves. (1) Insist a pixel is an area, not a point, and see rendering as sampling a 2D signal whose edges carry infinite frequency — point-sampling below Nyquist makes those high frequencies masquerade as low ones (jaggies, moiré: two faces of one disease). (2) State the ideal answer: each pixel is the average of the image over its little square — a box prefilter, convolve-then-sample — which we cannot integrate in closed form, so we approximate it with more samples. (3) Supersampling (SSAA) and MSAA: brute-force correctness vs the trick of sampling coverage many times but shading once. (4) Post-process AA (FXAA/SMAA): detect edges in the finished image and blur across them — cheap, universal, lossy. (5) Temporal AA (TAA): jitter the samples each frame and accumulate over time with motion reprojection — and its ghosting, which bridges to lesson 15's ML upscalers. Then lesson 07 opens the light integral we have been pretending is a single color.
五步走。(1) 坚持像素是面积,不是点,把渲染看成对一个二维信号采样,而这个信号的边缘携带无穷高的频率——在奈奎斯特之下做点采样,会让那些高频伪装成低频(锯齿、摩尔纹:同一个病的两张脸)。(2) 陈述理想答案:每个像素是图像在它那一小方块上的平均——一个盒式预滤波,先卷积再采样——它无法闭式积分,所以我们用更多样本去近似它。(3) 超采样(SSAA)与 MSAA:蛮力求正确,对比“多次采样覆盖率、只着色一次”的巧计。(4) 后处理抗锯齿(FXAA/SMAA):在成品图里检测边缘并沿它模糊——便宜、通用、有损。(5) 时域抗锯齿(TAA):每帧抖动样本、借运动重投影跨帧累积——以及它的鬼影,这引向第 15 课的 ML 上采样器。随后第 07 课打开那个我们一直假装成单一颜色的光照积分。
1 · A pixel is an area, not a point — and edges carry infinite frequency像素是面积,不是点——而边缘携带无穷高的频率
Reframe what the rasterizer of lesson 04 actually does. The ideal image is a continuous 2D signal: a function I(x, y) giving a color at every real-valued position. Rendering to a grid of pixels is sampling that signal. Lessons 04–05 sampled it at exactly one point — the pixel center (x + 0.5, y + 0.5) — and used whatever surface sat under that point as the answer for the whole cell. But the cell is a square of area, and the signal inside it can vary wildly.
重新审视第 04 课的光栅化器到底在做什么。理想图像是一个连续的二维信号:一个函数 I(x, y),在每个实数位置给出一个颜色。渲染到像素网格,就是对这个信号采样。第 04–05 课恰好在一个点——像素中心 (x + 0.5, y + 0.5)——采样它,并把那个点下的表面当作整个格子的答案。但格子是一块方形面积,其内部的信号可以剧烈变化。
Here is the sharp part. At a geometry edge — the boundary of a triangle — the ideal signal jumps from one color to another instantaneously. In frequency terms, a step edge contains arbitrarily high frequencies (a perfect step is a sum of sinusoids up to infinity). The CV track's Nyquist–Shannon theorem said you can only faithfully represent frequencies below half your sampling rate: fs > 2·fmax. An edge has fmax = ∞. There is no pixel grid dense enough to satisfy Nyquist against a hard edge. We are permanently under-sampling. The only question is what to do about it.
关键在这里。在几何边缘——三角形的边界——处,理想信号瞬间从一种颜色跳到另一种。用频率的话说,一个阶跃边缘包含任意高的频率(一个完美阶跃是直到无穷的正弦之和)。CV 课的奈奎斯特–香农定理说:你只能忠实表示低于采样率一半的频率:fs > 2·fmax。而一条边缘的 fmax = ∞。没有任何像素网格能密到对一条硬边缘满足奈奎斯特。我们永远在欠采样。唯一的问题是拿它怎么办。
When you sample below Nyquist, the energy in the high frequencies does not vanish — it folds down and impersonates a low frequency. That impersonation is aliasing (the high frequency wears the "alias" of a low one), and it has two familiar faces:
当你在奈奎斯特之下采样,高频里的能量不会消失——它会折叠下来、冒充成一个低频。这种冒充就是走样(高频戴上了低频的“别名/化名”),它有两张熟悉的脸:
Static jaggies are the spatial face; crawling and shimmer are the temporal face — the same aliased frequencies shifting as the sample grid moves across the signal frame to frame. Recognizing them as one phenomenon is the whole point: every fix below is, at heart, the same move — reduce the signal's frequency content before (or while) sampling.
静态锯齿是空间那张脸;蠕动与闪烁是时间那张脸——同样那些走样的频率,随采样网格逐帧扫过信号而移动。把它们认作同一个现象,正是要点所在:下面每一种修复,其内核都是同一招——在采样之前(或采样之时)压掉信号的高频成分。
2 · The ideal answer: a pixel is the average over its area理想答案:像素是其面积上的平均
If a pixel is an area, its honest value is not "the color at the center" but the average of the image over that little square. Signal theory says the same thing more precisely: to sample without aliasing, first low-pass filter the continuous signal (a prefilter), then sample. Convolve, then pick. The simplest prefilter is a box: average uniformly over the pixel's footprint. A slightly better one is a tent (triangle) filter that weights the center more; the theoretical ideal is a sinc, but its infinite ringing negative lobes make box/tent the practical choice.
如果像素是面积,它诚实的值就不是“中心处的颜色”,而是图像在那一小方块上的平均。信号理论把同一件事说得更精确:要无走样地采样,先对连续信号做低通滤波(一个预滤波),再采样。先卷积,再挑点。最简单的预滤波是盒式:在像素足迹上做均匀平均。稍好一点的是帐篷(三角)滤波,给中心更高权重;理论上的理想是 sinc,但它无穷延展、带振铃的负瓣,使盒式/帐篷成为实用之选。
For a pixel straddling a single straight edge, the box-filtered value has an exact meaning: it is the fraction of the pixel's area covered by the near surface, blended with the rest. Call that fraction the coverage c ∈ [0, 1]:
对于一个跨在单条直边上的像素,盒式滤波后的值有精确含义:它是像素面积被近处表面覆盖的比例,与其余部分做混合。把这个比例叫作覆盖率 c ∈ [0, 1]:
A pixel fully inside gets c = 1, fully outside c = 0, and one the edge cuts in half gets c = 0.5 — a mid-gray, which is exactly the soft edge our eye reads as smooth. Point-sampling can only ever return c ∈ \{0, 1\}: it rounds every straddling pixel to fully-in or fully-out, and that rounding is the staircase.
完全在内的像素得 c = 1,完全在外得 c = 0,被边缘对半切的得 c = 0.5——一个中灰,正是我们眼睛读作平滑的那条柔和边缘。点采样永远只能返回 c ∈ \{0, 1\}:它把每一个跨边像素四舍五入成全内或全外,而这个四舍五入就是那道阶梯。
The wall: for real geometry we cannot integrate that coverage in closed form. The visibility function — "is this exact point inside the nearest triangle?" — is a discontinuous, scene-dependent thing with no tidy antiderivative once triangles overlap, curve, and occlude. So we do what numerical integration always does when the integrand is intractable: approximate the integral by taking more samples and averaging them. Every anti-aliasing method below is one particular budget-conscious way to estimate that per-pixel area average.
那堵墙:对真实几何,我们无法闭式地积分那个覆盖率。可见性函数——“这个精确点是否在最近的三角形内?”——是一个不连续、依赖场景的东西,一旦三角形重叠、弯曲、遮挡,就没有整洁的原函数。于是我们做数值积分在被积函数棘手时一贯做的事:用更多样本去近似这个积分并求平均。下面每一种抗锯齿方法,都是估计这个每像素面积平均的、某一种精打细算的办法。
3 · Supersampling (SSAA) and MSAA — sample coverage, shade once超采样(SSAA)与 MSAA——采样覆盖率,只着色一次
Supersampling (SSAA) is the brute-force, obviously-correct estimator: render the whole image at k× the resolution (say 4× the pixels, a 2×2 subsample grid per output pixel), then downfilter — box-average each block of subsamples down to one pixel. With enough subsamples per pixel the average converges to the true area integral, so SSAA fixes all aliasing at once: geometry edges, texture shimmer, and shader aliasing (specular sparkle) alike, because it re-evaluates the entire pipeline at every subsample.
超采样(SSAA)是那个蛮力、显然正确的估计器:把整幅图像按 k× 分辨率渲染(比如 4 倍像素,每个输出像素配一个 2×2 子采样网格),然后下采样滤波——把每一块子采样盒式平均成一个像素。子采样足够多时,平均会收敛到真实的面积积分,所以 SSAA 一次性修好所有走样:几何边缘、纹理闪烁、着色走样(高光的碎闪)一视同仁,因为它在每个子采样处重新求了整条流水线。
The price is brutal and it is the reason SSAA is rare in real time. At k× supersampling you run the fragment shader — the expensive per-pixel lighting of lessons 08–11 — k× as many times. 4× SSAA is 4× the shading cost; 16× is 16×. Shading, not coverage, is where the money goes, so paying k× for it to fix what is mostly an edge problem is wasteful.
代价残酷,这也是 SSAA 在实时中罕见的原因。在 k× 超采样下,你把片元着色器——第 08–11 课那昂贵的每像素光照——运行 k× 次。4× SSAA 是 4 倍着色开销;16× 就是 16 倍。钱花在着色上,而不是覆盖率上,所以为了修一个基本上属于边缘的问题而付 k× 的着色费,太浪费了。
MSAA (multisample anti-aliasing) is the key insight that made hardware AA affordable, and it is worth stating precisely because interviewers love the distinction. MSAA decouples the two things SSAA conflated:
MSAA(多重采样抗锯齿)是让硬件抗锯齿变得负担得起的关键洞见,值得精确陈述,因为面试官钟爱这个区别。MSAA 把 SSAA 混为一谈的两件事解耦了:
- Coverage & depth are evaluated at N subsample positions per pixel (e.g. 4× MSAA → 4 subsamples). This is cheap: it is just extra point-in-triangle and depth tests, the arithmetic of lesson 04.覆盖率与深度在每像素 N 个子采样位置上求值(如 4× MSAA → 4 个子采样)。这很便宜:无非是额外的点在三角形内测试与深度测试,即第 04 课的算术。
- Shading runs once per pixel (usually at the center), and that one color is written to whichever subsamples the triangle covered. At the end, the subsamples in a pixel are averaged (resolved).着色每像素只跑一次(通常在中心),这一个颜色被写入三角形覆盖到的那些子采样。最后,一个像素内的子采样被求平均(解析 resolve)。
So a pixel on a triangle edge gets, say, 2 of 4 subsamples covered → resolved to 50% of the triangle's shaded color blended with 50% background: a smooth edge, at roughly the coverage quality of 4× SSAA but only one shader evaluation. The catch, and the exam answer: MSAA anti-aliases geometry edges only. Because shading runs once per pixel, it does nothing for aliasing that lives inside a shaded surface — a high-frequency texture (that is the sampler/mipmap's job, lesson 05) or a razor-thin specular highlight. That blind spot is exactly what pushed the industry toward post-process and temporal methods.
于是三角形边缘上的一个像素,比如 4 个子采样里覆盖了 2 个 → 解析为 50% 三角形着色颜色与 50% 背景的混合:一条平滑边缘,覆盖质量大约相当于 4× SSAA,却只有一次着色求值。玄机、也是考试答案:MSAA 只对几何边缘抗锯齿。因为着色每像素只跑一次,它对住在着色表面内部的走样毫无办法——高频纹理(那是采样器/mipmap 的活,第 05 课)或一条刀锋般细的高光。正是这个盲点,把业界推向了后处理与时域方法。
Coverage over an N×N grid is a Riemann sum for the true area integral of section 2. With spp = 1 the estimate is a single sample — it can only be 0 or 1, so the edge staircases. spp = 4 gives coverage in steps of 1/4; spp = 16 in steps of 1/16 — finer gradations, a smoother edge, and cost that grows as N². This is SSAA's coverage quality exactly. What the widget does not show is shading cost, because a half-plane has no shader — and that omission is precisely why MSAA can buy this same edge for the price of one shade: the grays here are a coverage average, not a lighting average.
N×N 网格上的覆盖率,是第 2 节那个真实面积积分的一个黎曼和。spp = 1 时估计只有一个样本——只能是 0 或 1,于是边缘阶梯化。spp = 4 给出以 1/4 为步长的覆盖率;spp = 16 给出以 1/16 为步长的覆盖率——更细的层级、更平滑的边缘,而开销随 N² 增长。这正是 SSAA 的覆盖质量。控件没展示的是着色开销,因为半平面没有着色器——而正是这一省略,说明了 MSAA 为何能以一次着色的价钱买下这条同样的边缘:这里的灰是覆盖率平均,不是光照平均。
4 · Post-process AA — find the edges in the finished image and blur across them后处理抗锯齿——在成品图里找到边缘并沿它模糊
SSAA and MSAA both add work before the pixel is finished — extra samples in the pipeline. Post-process AA comes at it from the opposite end: render the image normally at 1 spp, then run a cheap image-space filter over the finished frame. FXAA (Fast Approximate AA) is the canonical example. Its recipe: scan the final color buffer for large local contrast (a luminance step = a likely edge), estimate the edge's orientation from neighboring pixels, then blend the pixel with its neighbors along the edge — smearing the staircase into a gradient.
SSAA 与 MSAA 都在像素完成之前加活——在流水线里多采样。后处理抗锯齿从相反的一端下手:先正常按 1 spp 渲染图像,再对成品帧跑一个便宜的图像空间滤波。FXAA(快速近似抗锯齿)是典范。它的配方:在最终颜色缓冲里扫描大的局部对比(一次亮度阶跃 = 很可能是边缘),从邻近像素估计边缘朝向,然后把该像素与它沿边缘方向的邻居混合——把阶梯抹成渐变。
The trade is stark and worth memorizing. FXAA is astonishingly cheap — a single full-screen pass, a fixed millisecond or two regardless of scene complexity — and universal: it works on any finished image, so unlike MSAA it happily smooths shader aliasing and specular sparkle too, and it composes with deferred rendering (where MSAA is awkward). The downside: it is guessing. It has no coverage information and no sub-pixel truth to recover — it only has the 1-spp result, in which detail finer than a pixel is already destroyed. So FXAA softens: it blurs real texture and text along with the jaggies, and it can misfire on edges it misidentifies. SMAA is a more careful cousin (better edge detection, pattern-matched blend weights) that softens less, but the family verdict stands — post-process AA hides aliasing rather than resolving it, because the information was gone before the filter ran.
这笔交易鲜明、值得背下。FXAA 便宜得惊人——一个全屏 pass,无论场景多复杂都固定一两毫秒——而且通用:它作用于任何成品图,所以不像 MSAA,它乐于把着色走样与高光碎闪也抹平,并且能与延迟渲染(MSAA 在那里很别扭)组合。缺点是:它在猜。它没有覆盖率信息,也没有可恢复的亚像素真相——它只有 1 spp 的结果,其中细于一像素的细节早已被毁。所以 FXAA 会变软:它把真实纹理与文字连同锯齿一起模糊,还可能在误判的边缘上出错。SMAA 是更讲究的表亲(更好的边缘检测、按模式匹配的混合权重),变软更少,但这一家的判词不变——后处理抗锯齿是掩盖走样而非解决它,因为信息在滤波器运行之前就已经没了。
| Method | What it samples more of | Fixes | Cost driver | Main downside |
|---|---|---|---|---|
| SSAA (k×) | everything, k× per pixel | edges + texture + shader | k× shading | brutally expensive |
| MSAA (N×) | coverage + depth, N× per pixel | geometry edges only | N× coverage, 1× shading | ignores shader/texture aliasing |
| FXAA / SMAA | nothing — post-filters 1 spp | any visible edge | one screen pass (cheap, fixed) | softens detail; guesses, can't recover sub-pixel |
| TAA | 1 spp/frame, jittered + accumulated | edges + texture + shader, over time | ~1 spp + a reprojection pass | ghosting; needs motion vectors + history clamp |
| 方法 | 它多采样了什么 | 能修 | 开销主因 | 主要缺点 |
|---|---|---|---|---|
| SSAA(k×) | 一切,每像素 k 次 | 边缘 + 纹理 + 着色 | k 倍着色 | 极其昂贵 |
| MSAA(N×) | 覆盖率 + 深度,每像素 N 次 | 仅几何边缘 | N 倍覆盖率,1 倍着色 | 忽略着色 / 纹理走样 |
| FXAA / SMAA | 不多采样——对 1 spp 做后滤波 | 任何可见边缘 | 一个屏幕 pass(便宜、固定) | 使细节变软;靠猜,无法恢复亚像素 |
| TAA | 每帧 1 spp,抖动 + 累积 | 边缘 + 纹理 + 着色,随时间 | 约 1 spp + 一个重投影 pass | 鬼影;需运动向量 + 历史裁剪 |
5 · Temporal AA (TAA) — spread the supersampling across time时域抗锯齿(TAA)——把超采样摊到时间上
Here is the idea that dominates modern real-time rendering, and it is genuinely clever. SSAA's problem was paying for many samples within one frame. But a game renders 60 frames a second, and the camera barely moves between two of them. Temporal AA takes one sample per pixel per frame — but jitters the sample position by a tiny sub-pixel offset that changes every frame (cycling through a low-discrepancy pattern such as Halton). Frame 1 samples slightly left, frame 2 slightly up-right, and so on. Accumulate the last several frames and each pixel has effectively been supersampled — the many samples were spread across time instead of packed into one frame. You get SSAA-like quality for roughly the cost of 1 spp plus one blend.
这是主宰现代实时渲染的思路,而且确实精巧。SSAA 的问题在于在一帧之内为许多样本买单。可游戏每秒渲染 60 帧,相邻两帧之间相机几乎没动。时域抗锯齿每帧每像素只取一个样本——但把采样位置抖动一个极小的亚像素偏移,且每帧都变(在如 Halton 这类低差异序列中循环)。第 1 帧稍偏左采样,第 2 帧稍偏右上,如此往复。把最近若干帧累积起来,每个像素实际上就被超采样了——那许多样本被摊到了时间上,而非塞进一帧里。你以大约 1 spp 加一次混合的开销,得到近似 SSAA 的质量。
The complication is motion. If either the camera or an object moves, last frame's pixel does not correspond to this frame's pixel, so blindly averaging history would smear moving objects into trails. TAA fixes this with motion vectors (velocity per pixel, output by the renderer) that reproject each pixel back to where its surface was last frame, so the accumulated samples line up on the same surface point. Where reprojection fails — a newly disoccluded background, a surface entering the screen — there is no valid history, and blending stale color produces ghosting: a faint trailing after-image behind motion.
麻烦在于运动。若相机或物体移动,上一帧的像素与这一帧的像素并不对应,所以盲目地平均历史会把运动物体抹成拖尾。TAA 用运动向量(每像素速度,由渲染器输出)修这一点:它把每个像素重投影回它的表面上一帧所在之处,让累积的样本对齐到同一个表面点上。重投影失败之处——刚被解遮挡露出的背景、正进入画面的表面——没有有效历史,混合陈旧颜色就产生鬼影:运动后方一道淡淡的拖尾残像。
The standard defense is history clamping (a.k.a. neighborhood clipping): before blending, clamp the reprojected history color to the range of colors in the current frame's local neighborhood. If history disagrees too much with what is actually here now, it is rejected or pulled toward the current sample — trading a little residual aliasing for far less ghosting. Tuning that clamp, plus jitter pattern and history weight, is most of the art of shipping a good TAA. And this is the direct on-ramp to lesson 15: DLSS / FSR and other ML upscalers are, in essence, temporal accumulation with a learned reprojection-and-clamp — they render at low resolution, jitter, and let a network do the reprojection, history rejection, and upscaling that hand-tuned TAA does with heuristics.
标准防御是历史裁剪(又称邻域裁剪):混合之前,把重投影得到的历史颜色,裁剪到当前帧局部邻域颜色的取值范围内。若历史与此刻这里实际的颜色分歧太大,就拒用它或把它拉向当前样本——用一点残余走样换取少得多的鬼影。调这个裁剪,加上抖动模式与历史权重,就是做好一版 TAA 的大半门道。而这正是通往第 15 课的直接入口:DLSS / FSR 等 ML 上采样器,本质上就是带一个学出来的重投影与裁剪的时域累积——它们以低分辨率渲染、抖动,再让一个网络去做那些手调 TAA 用启发式完成的重投影、历史拒绝与放大。
Where this points next接下来指向何处
We have now closed the loop opened in lesson 01, where we noted a pixel is an area, not a point. Rendering samples a continuous signal whose edges are infinitely sharp, so aliasing is not a bug but a permanent consequence of sampling below Nyquist — and every fix, from SSAA to TAA, is a way to estimate the per-pixel area average that point-sampling skipped. But there is a second thing every method above quietly assumed: that a "shaded color" for a surface already exists to be averaged. We have never said where that color comes from. What is the light leaving a surface toward the eye, and how does material turn incoming light into it? Lesson 07 reopens the rendering equation from lesson 01 in earnest — radiance, irradiance, the BRDF, and the hemisphere integral — the physics that produces the very colors this lesson worked so hard to average correctly.
我们现在合上了第 01 课打开的那个环:那里我们指出像素是面积、不是点。渲染在对一个边缘无穷锐利的连续信号采样,所以走样不是 bug,而是在奈奎斯特之下采样的永久后果——而每一种修复,从 SSAA 到 TAA,都是估计点采样跳过的那个每像素面积平均的办法。但上面每种方法都还悄悄假设了第二件事:一个可供平均的表面“着色颜色”已经存在。我们从未说过那颜色从哪来。从表面射向眼睛的光是什么,材质又如何把入射光变成它?第 07 课认真重开第 01 课的渲染方程——辐射亮度、辐照度、BRDF 与半球积分——正是这套物理,产生了本课费尽力气去正确平均的那些颜色。
A pixel is an area, so rendering is sampling a 2D signal. Geometry edges carry infinite frequency, so point-sampling always violates Nyquist (fs > 2fmax) and high frequencies alias down — jaggies (spatial) and moiré/shimmer (temporal) are one disease. The ideal value is the area average (a box/tent prefilter, convolve-then-sample); since visibility has no closed form, we estimate it with more samples. SSAA renders at k× and downfilters — fixes everything but pays k× shading. MSAA samples coverage/depth N× but shades once — most of SSAA's edge quality cheaply, but geometry edges only. FXAA/SMAA post-filter the finished frame — cheap and universal, but they softly guess and can't recover sub-pixel detail. TAA jitters 1 spp per frame and accumulates via motion-vector reprojection — SSAA-quality over time, at the cost of ghosting, tamed by history clamping — the direct ancestor of lesson 15's ML upscalers.
像素是面积,所以渲染是对二维信号采样。几何边缘携带无穷高频,故点采样永远违反奈奎斯特(fs > 2fmax),高频折叠走样——锯齿(空间)与摩尔纹/闪烁(时间)是同一个病。理想值是面积平均(一个盒式/帐篷预滤波,先卷积再采样);由于可见性无闭式解,我们用更多样本去估计它。SSAA 按 k× 渲染再下滤波——修好一切,但付 k× 着色。MSAA 按 N× 采样覆盖率/深度,却只着色一次——便宜地拿到 SSAA 大半的边缘质量,但仅限几何边缘。FXAA/SMAA 对成品帧后滤波——便宜、通用,但它们柔和地猜,无法恢复亚像素细节。TAA 每帧抖动 1 spp 并借运动向量重投影累积——随时间得到 SSAA 质量,代价是鬼影,靠历史裁剪驯服——正是第 15 课 ML 上采样器的直系祖先。
Interview prompts面试题
- Why does treating a pixel as a point cause aliasing, and how does Nyquist explain it? (§1 — a pixel is an area but point-sampling reads one location; a geometry edge is a step with infinite frequency, so it always exceeds fs/2 and its high frequencies fold down (alias) into spurious low ones — jaggies.) 为什么把像素当作点会导致走样,奈奎斯特如何解释它?(§1 — 像素是面积,但点采样只读一个位置;几何边缘是一个无穷高频的阶跃,故它总是超过 fs/2,其高频折叠下来(走样)成虚假的低频——即锯齿。)
- Why must you prefilter before downsampling rather than just picking every k-th pixel? (§2 — sampling first keeps the aliased high frequencies; a low-pass prefilter removes energy above the new Nyquist limit so the surviving signal is representable — the ideal pixel is the area average, not a point.) 为什么必须在下采样之前预滤波,而不能只是每隔 k 个像素取一个?(§2 — 先采样会保留走样的高频;一个低通预滤波先去掉高于新奈奎斯特极限的能量,使幸存信号可被表示——理想像素是面积平均,而非一个点。)
- Contrast SSAA and MSAA on cost and quality. (§3 — SSAA re-shades at every subsample: k× shading, fixes edges + texture + shader aliasing. MSAA samples coverage/depth N× but shades once per pixel: near-SSAA edge quality at ~1× shading, but does nothing for shader/texture aliasing.) 从开销与质量上对比 SSAA 与 MSAA。(§3 — SSAA 在每个子采样重新着色:k 倍着色,修好边缘 + 纹理 + 着色走样。MSAA 按 N× 采样覆盖率/深度但每像素只着色一次:以约 1 倍着色拿到接近 SSAA 的边缘质量,但对着色/纹理走样毫无办法。)
- What does FXAA actually do, and what is its fundamental limitation? (§4 — it detects high-contrast edges in the finished 1-spp image and blends across them; being purely post-process it has no coverage or sub-pixel information, so it softens/blurs real detail and can only hide aliasing, not resolve it.) FXAA 到底做了什么,它的根本局限是什么?(§4 — 它在成品的 1 spp 图像里检测高对比边缘并沿其混合;作为纯后处理,它没有覆盖率或亚像素信息,故会使真实细节变软/模糊,只能掩盖走样而非解决它。)
- Explain the TAA idea and why ghosting happens. (§5 — jitter one sample per pixel each frame and accumulate over time via motion-vector reprojection, amortizing supersampling; ghosting appears where reprojection has no valid history (disocclusion, new geometry) and stale color is blended in — mitigated by history/neighborhood clamping.) 解释 TAA 的思路,以及鬼影为何发生。(§5 — 每帧每像素抖动一个样本,借运动向量重投影跨时间累积,把超采样摊薄;鬼影出现在重投影没有有效历史之处(解遮挡、新几何),因为混入了陈旧颜色——用历史/邻域裁剪来缓解。)
- A colleague says jaggies and texture moiré are unrelated problems. Correct them. (§1 — they are one phenomenon: both are frequency content above fs/2 (a sharp edge, or sub-pixel texture detail) folding down to a false low frequency; the static face is jaggies, the moving face is shimmer/moiré, and the same prefilter-then-sample cure addresses both.) 同事说锯齿和纹理摩尔纹是不相干的两个问题。纠正他。(§1 — 它们是同一个现象:两者都是高于 fs/2 的频率成分(一条锐边,或亚像素的纹理细节)折叠成一个虚假低频;静态那张脸是锯齿,运动那张脸是闪烁/摩尔纹,同一剂“先预滤波再采样”的药方对两者都管用。)