505 lines
51 KiB
HTML
505 lines
51 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
|
||
<meta charset="UTF-8" />
|
||
|
||
<meta name="generator" content="Hugo 0.113.0"><meta name="theme-color" content="#fff" />
|
||
<meta name="color-scheme" content="light dark">
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
|
||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no" />
|
||
|
||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||
|
||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||
|
||
<title>走样与反走样 | 飞鸿踏雪</title>
|
||
|
||
<link rel="stylesheet" href="/css/meme.min.12a3541920a798d49c1bca858f15c53090f14ce9367a34faa2bb51dd38299730.css"/>
|
||
|
||
|
||
|
||
<script src="/js/meme.min.ac2b48f322cff6a9a8036be3baf3e59e300cd9e4191997a8c3765f79de02bf8d.js"></script>
|
||
|
||
|
||
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,700;1,400;1,700&family=Noto+Serif+SC:wght@400;500;700&family=Source+Code+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap" media="print" onload="this.media='all'" />
|
||
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,700;1,400;1,700&family=Noto+Serif+SC:wght@400;500;700&family=Source+Code+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap" /></noscript>
|
||
|
||
<meta name="author" content="InkSoul" /><meta name="description" content="走样 从像素角度 屏幕是由一个个像素组成,在光栅化时,只有中心被三角形覆盖的像素会被着色……" />
|
||
|
||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
|
||
<link rel="mask-icon" href="/icons/safari-pinned-tab.svg" color="#2a6df4" />
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
|
||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||
<meta name="apple-mobile-web-app-title" content="飞鸿踏雪" />
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||
<meta name="mobile-web-app-capable" content="yes" />
|
||
<meta name="application-name" content="飞鸿踏雪" />
|
||
<meta name="msapplication-starturl" content="../../" />
|
||
<meta name="msapplication-TileColor" content="#fff" />
|
||
<meta name="msapplication-TileImage" content="../../icons/mstile-150x150.png" />
|
||
<link rel="manifest" href="/manifest.json" />
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="canonical" href="http://www.inksoul.top/computergraphic/%E8%B5%B0%E6%A0%B7%E4%B8%8E%E5%8F%8D%E8%B5%B0%E6%A0%B7/" />
|
||
|
||
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "BlogPosting",
|
||
"datePublished": "2022-05-12T22:08:22+08:00",
|
||
"dateModified": "2023-06-18T21:19:01+08:00",
|
||
"url": "http://www.inksoul.top/computergraphic/%E8%B5%B0%E6%A0%B7%E4%B8%8E%E5%8F%8D%E8%B5%B0%E6%A0%B7/",
|
||
"headline": "走样与反走样",
|
||
"description": "走样 从像素角度 屏幕是由一个个像素组成,在光栅化时,只有中心被三角形覆盖的像素会被着色……",
|
||
"inLanguage" : "zh-CN",
|
||
"articleSection": "computergraphic",
|
||
"wordCount": 2574 ,
|
||
"image": ["http://www.inksoul.top/../../images/aliasing_pixel.png","http://www.inksoul.top/../../images/sample_and_reconstruct.png","http://www.inksoul.top/../../images/figure.5.17.png","http://www.inksoul.top/../../images/figure5.17.1.png","http://www.inksoul.top/../../images/three_filter.png","http://www.inksoul.top/../../images/box_filter_construct.png","http://www.inksoul.top/../../images/tent_filter_constructed.png","http://www.inksoul.top/../../images/convolution_theorem.png","http://www.inksoul.top/../../images/sinc_filter_process.png","http://www.inksoul.top/../../images/resample_upsample.png","http://www.inksoul.top/../../images/resample_downsampling.png","http://www.inksoul.top/../../images/sample_resulst.png","http://www.inksoul.top/../../images/pre-filter_sample.png","http://www.inksoul.top/../../images/Screen-Based.png","http://www.inksoul.top/../../images/sample_point_position.png","http://www.inksoul.top/../../images/MSAA.png","http://www.inksoul.top/../../images/MSAA_sample.png","http://www.inksoul.top/../../images/MSAA_color.png","http://www.inksoul.top/../../images/EQAA_color_table.png"],
|
||
"author": {
|
||
"@type": "Person",
|
||
"email": "qingci30@163.com",
|
||
"image": "http://www.inksoul.top/icons/apple-touch-icon.png",
|
||
"url": "http://www.inksoul.top",
|
||
"name": "InkSoul"
|
||
},
|
||
"license": "[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)",
|
||
"publisher": {
|
||
"@type": "Organization",
|
||
"name": "飞鸿踏雪",
|
||
"logo": {
|
||
"@type": "ImageObject",
|
||
"url": "http://www.inksoul.top/icons/apple-touch-icon.png"
|
||
},
|
||
"url": "http://www.inksoul.top/"
|
||
},
|
||
"mainEntityOfPage": {
|
||
"@type": "WebSite",
|
||
"@id": "http://www.inksoul.top/"
|
||
}
|
||
}
|
||
</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<meta property="og:title" content="走样与反走样" />
|
||
<meta property="og:description" content="走样 从像素角度 屏幕是由一个个像素组成,在光栅化时,只有中心被三角形覆盖的像素会被着色……" />
|
||
<meta property="og:url" content="http://www.inksoul.top/computergraphic/%E8%B5%B0%E6%A0%B7%E4%B8%8E%E5%8F%8D%E8%B5%B0%E6%A0%B7/" />
|
||
<meta property="og:site_name" content="飞鸿踏雪" />
|
||
<meta property="og:locale" content="zh" /><meta property="og:image" content="http://www.inksoul.top/../../images/aliasing_pixel.png" />
|
||
<meta property="og:type" content="article" />
|
||
<meta property="article:published_time" content="2022-05-12T22:08:22+08:00" />
|
||
<meta property="article:modified_time" content="2023-06-18T21:19:01+08:00" />
|
||
|
||
<meta property="article:section" content="computergraphic" />
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</head>
|
||
|
||
<body>
|
||
<div class="container">
|
||
|
||
<header class="header">
|
||
|
||
<div class="header-wrapper">
|
||
<div class="header-inner single">
|
||
|
||
<div class="site-brand">
|
||
|
||
<a href="/" class="brand">飞鸿踏雪</a>
|
||
|
||
</div>
|
||
|
||
<nav class="nav">
|
||
<ul class="menu" id="menu">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="menu-item active"><a href="/computergraphic/"><svg class="icon computergraphic" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path></svg><span class="menu-item-name">图形学</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="menu-item"><a href="/algorithm/"><svg class="icon algorithm" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path></svg><span class="menu-item-name">算法</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="menu-item"><a href="/mathematics/"><svg class="icon mathematics" fill="none" stroke="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path stroker-linecap="round" stroke-linejoin="round" stroker-width="2" d="M576 32.01c0-17.69-14.33-31.1-32-31.1l-224-.0049c-14.69 0-27.48 10-31.05 24.25L197.9 388.3L124.6 241.7C119.2 230.9 108.1 224 96 224L32 224c-17.67 0-32 14.31-32 31.1s14.33 32 32 32h44.22l103.2 206.3c5.469 10.91 16.6 17.68 28.61 17.68c1.172 0 2.323-.0576 3.495-.1826c13.31-1.469 24.31-11.06 27.56-24.06l105.9-423.8H544C561.7 64.01 576 49.7 576 32.01zM566.6 233.4c-12.5-12.5-32.75-12.5-45.25 0L480 274.8l-41.38-41.37c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25l41.38 41.38l-41.38 41.38c-12.5 12.5-12.5 32.75 0 45.25C399.6 412.9 407.8 416 416 416s16.38-3.125 22.62-9.375L480 365.3l41.38 41.38C527.6 412.9 535.8 416 544 416s16.38-3.125 22.62-9.375c12.5-12.5 12.5-32.75 0-45.25l-41.38-41.38L566.6 278.6C579.1 266.1 579.1 245.9 566.6 233.4z"/></svg><span class="menu-item-name">数学</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="menu-item"><a href="/408/"><svg class="icon 408" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticon 408s, Inc. --><path d="M172.1 40.16L268.1 3.76C280.9-1.089 295.1-1.089 307.9 3.76L403.9 40.16C425.6 48.41 440 69.25 440 92.52V204.7C441.3 205.1 442.6 205.5 443.9 205.1L539.9 242.4C561.6 250.6 576 271.5 576 294.7V413.9C576 436.1 562.9 456.2 542.5 465.1L446.5 507.3C432.2 513.7 415.8 513.7 401.5 507.3L288 457.5L174.5 507.3C160.2 513.7 143.8 513.7 129.5 507.3L33.46 465.1C13.13 456.2 0 436.1 0 413.9V294.7C0 271.5 14.39 250.6 36.15 242.4L132.1 205.1C133.4 205.5 134.7 205.1 136 204.7V92.52C136 69.25 150.4 48.41 172.1 40.16V40.16zM290.8 48.64C289 47.95 286.1 47.95 285.2 48.64L206.8 78.35L287.1 109.5L369.2 78.35L290.8 48.64zM392 210.6V121L309.6 152.6V241.8L392 210.6zM154.8 250.9C153 250.2 150.1 250.2 149.2 250.9L70.81 280.6L152 311.7L233.2 280.6L154.8 250.9zM173.6 455.3L256 419.1V323.2L173.6 354.8V455.3zM342.8 280.6L424 311.7L505.2 280.6L426.8 250.9C425 250.2 422.1 250.2 421.2 250.9L342.8 280.6zM528 413.9V323.2L445.6 354.8V455.3L523.2 421.2C526.1 419.9 528 417.1 528 413.9V413.9z"/></svg><span class="menu-item-name">408</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="menu-item"><a href="/stuff/"><svg class="icon stuff" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticon stuffs, Inc. --><path d="M216 104C202.8 104 192 114.8 192 128s10.75 24 24 24c79.41 0 144 64.59 144 144C360 309.3 370.8 320 384 320s24-10.75 24-24C408 190.1 321.9 104 216 104zM224 0C206.3 0 192 14.31 192 32s14.33 32 32 32c123.5 0 224 100.5 224 224c0 17.69 14.33 32 32 32s32-14.31 32-32C512 129.2 382.8 0 224 0zM188.9 346l27.37-27.37c2.625 .625 5.059 1.506 7.809 1.506c17.75 0 31.99-14.26 31.99-32c0-17.62-14.24-32.01-31.99-32.01c-17.62 0-31.99 14.38-31.99 32.01c0 2.875 .8099 5.25 1.56 7.875L166.2 323.4L49.37 206.5c-7.25-7.25-20.12-6-24.1 3c-41.75 77.88-29.88 176.7 35.75 242.4c65.62 65.62 164.6 77.5 242.4 35.75c9.125-5 10.38-17.75 3-25L188.9 346z"/></svg><span class="menu-item-name">杂物</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
<li class="menu-item"><a href="/about/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" class="icon user-circle"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 96c48.6 0 88 39.4 88 88s-39.4 88-88 88-88-39.4-88-88 39.4-88 88-88zm0 344c-58.7 0-111.3-26.6-146.5-68.2 18.8-35.4 55.6-59.8 98.5-59.8 2.4 0 4.8.4 7.1 1.1 13 4.2 26.6 6.9 40.9 6.9 14.3 0 28-2.7 40.9-6.9 2.3-.7 4.7-1.1 7.1-1.1 42.9 0 79.7 24.4 98.5 59.8C359.3 421.4 306.7 448 248 448z"/></svg><span class="menu-item-name">关于</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="menu-item">
|
||
<a id="theme-switcher" href="#"><span class="icon theme-icon-light">🌞</span><span class="icon theme-icon-dark">🌙</span></a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<input type="checkbox" id="nav-toggle" aria-hidden="true" />
|
||
<label for="nav-toggle" class="nav-toggle"></label>
|
||
<label for="nav-toggle" class="nav-curtain"></label>
|
||
|
||
|
||
|
||
</header>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<main class="main single" id="main">
|
||
<div class="main-inner">
|
||
|
||
|
||
|
||
<article class="content post h-entry" data-align="justify" data-type="computergraphic" data-toc-num="true">
|
||
|
||
<h1 class="post-title p-name">走样与反走样</h1>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="post-body e-content">
|
||
<h3 id="走样"><a href="#走样" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>走样</h3>
|
||
<h4 id="从像素角度"><a href="#从像素角度" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>从像素角度</h4>
|
||
<p>屏幕是由一个个像素组成,在光栅化时,只有中心被三角形覆盖的像素会被着色,而且被覆盖的像素点的分布往往是离散的,自然而然地形成如下图斜线形成的阶梯状的锯齿</p>
|
||
<p><img src="../../images/aliasing_pixel.png" alt=""></p>
|
||
<hr>
|
||
<h4 id="从信号角度"><a href="#从信号角度" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>从信号角度</h4>
|
||
<h5 id="采样和滤波理论sampling-and-filtering-theory"><a href="#采样和滤波理论sampling-and-filtering-theory" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>采样和滤波理论(Sampling and Filtering Theory)</h5>
|
||
<h6 id="采样sample"><a href="#采样sample" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>采样(sample)</h6>
|
||
<p>采样就是将连续信号转换成离散信号(采样信号),经过滤波后会被恢复成重建信号</p>
|
||
<p><img src="../../images/sample_and_reconstruct.png" alt=""></p>
|
||
<p>如果采样的频率过低,则会发生走样或混叠(aliasing),如图中,蓝色的为原信号,红色为采样点,绿色虚线为重建后的信号</p>
|
||
<p>过低的采样频率会使重建的信号成为低频信号
|
||
<img src="../../images/figure.5.17.png" alt=""></p>
|
||
<p>若采样频率恰好是原信号的两倍,重建信号则表现为一条直线
|
||
<img src="../../images/figure5.17.1.png" alt=""></p>
|
||
<p>采样理论(sampling theorem):采样频率必须为原信号频率的两倍以上,才能完整地重建原始信号,存在一个最大频率,因而采样频率有频带限制
|
||
<br>奎斯特率(Nyquist rate): 频率为原信号频率两倍的采样频率<br></p>
|
||
<h6 id="重建reconstruction"><a href="#重建reconstruction" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>重建(reconstruction)</h6>
|
||
<p>重建时需要采样信号进行滤波,通常使用下图中的三种滤波器(box filter,tent filter,sinc filter),且滤波器的面积必须为1以确保恢复的信号不会被放大或缩小</p>
|
||
<p><img src="../../images/three_filter.png" alt=""></p>
|
||
<p>box filter 对信号进行滤波并重建信号的过程如下图
|
||
<br>直接将采样点位置替换为box filter波形的方式会因 box filter 本身的不连续使重建信号产生不平滑的现象<br>
|
||
但仍然因其易于实现的特性被用于重建</p>
|
||
<p><img src="../../images/box_filter_construct.png" alt=""></p>
|
||
<hr>
|
||
<p>tent filter 在滤波时会对每个相邻的采样点之间使用线性插值,一次重建的信号更加平滑,但采样点位置会发生斜率突变,所以tent filter 并不完美</p>
|
||
<p><img src="../../images/tent_filter_constructed.png" alt=""></p>
|
||
<hr>
|
||
<p>出于让重建信号保持平滑的目的,我们必须使用一个理想低通滤波器</p>
|
||
<p>基于傅立叶变换理论的解释:理想低通滤波器在频域中的表现类似于box filter,在频域中相乘时会过滤掉所有超过这个滤波器宽度的频率,在频域的box fliter 转换到空域的时候会是一个sinc filter ,在频域相乘也等价于在空域中进行卷积,卷积即为滤波
|
||
<img src="../../images/convolution_theorem.png" alt=""></p>
|
||
<p>例如sinc filter就能够实现过滤高频信号,保留低频信号的理想低通滤波器效果</p>
|
||
<p><img src="../../images/sinc_filter_process.png" alt=""></p>
|
||
<p>对于sinc filter 在假设采样频率为$f_s$,采样点间隔为$\frac{1}{f_S}$的情况下,它会过滤掉超过$\frac{f_S}{2}$的所有高频信息,因此,sinc filter 在采样频率为1.0会是一个理想低通滤波器,此时采样信号的最大频率应当小于$\frac{1}{2}$,但是由于sinc filter 有无限的滤波范围,所以它会在某些范围内出现负值</p>
|
||
<p>尽管负值的出现不常见,但在实践时我们更倾向于使用无负值的lobes(常见的有高斯滤波器(Gaussian filter)),并且使用重采样(resample)的方式对重建信号进行放大或者缩小</p>
|
||
<p>注:如果对于卷积为主的各类滤波感到不解可见<a href="https://www.bilibili.com/video/BV1Vd4y1e7pj/" target="_blank" rel="noopener">【官方双语】那么……什么是卷积?</a></p>
|
||
<hr>
|
||
<h4 id="重采样"><a href="#重采样" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>重采样</h4>
|
||
<p>设采样信号灯的采样间隔为整数列,间隔为1,则我们可以通过重采样来将采样点间隔变为a,当$a>1$时会缩小信号(downsampling),$a<1$时会放大信号(upsampling)</p>
|
||
<p>如图,对重建信号使用双倍采样率进行重采样便实现了信号放大
|
||
<img src="../../images/resample_upsample.png" alt=""></p>
|
||
<p>这种方法不适用于信号缩小,易使信号过于高频</p>
|
||
<p>对于信号缩小的情况,我们需要先对1间隔采样信号使用$sinc(\frac{x}{2})$ filter 滤波产生一个连续信号,再重采样2间隔,由于频谱范围更大的低通滤波器才能过滤更多的高频信号,类似于对图像进行第一次模糊再重采样产生一个低分辨率图像</p>
|
||
<p><img src="../../images/resample_downsampling.png" alt=""></p>
|
||
<p>由下图可见,滤波可以对三角形的边缘产生模糊,进而产生一定的反走样效果
|
||
<img src="../../images/sample_resulst.png" alt="">
|
||
<img src="../../images/pre-filter_sample.png" alt=""></p>
|
||
<h3 id="反走样"><a href="#反走样" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>反走样</h3>
|
||
<h4 id="现代反走样技术"><a href="#现代反走样技术" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>现代反走样技术</h4>
|
||
<h5 id="screen-based-antialiasing"><a href="#screen-based-antialiasing" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>Screen-Based Antialiasing</h5>
|
||
<p>对于我们之前提到的采样,我们只对像素正方形的中心进行是否在三角形内部的判断,这意味着对于边缘的像素正方形,无论覆盖面积有多大,只要不包含中心点都会被判定在三角形外,从而不被渲染,当采样率提升,如下图的4spp(sample per pixel)以某种方式混合计算获得更好的像素效果</p>
|
||
<p><img src="../../images/Screen-Based.png" alt=""></p>
|
||
<p>Screen-Based Antialiasing 通常在屏幕空间区域使用采样图案来采样从而对颜色进行如下的加权计算</p>
|
||
<p>对整个像素内颜色的平均计算遵循:
|
||
$$p(x,y)=\sum_{i=1}^nw_ic(i,x,y)$$
|
||
$n:$每个像素内采样点的数量</p>
|
||
<p>$c(i,x,y):$ 计算采样位置在屏幕坐标系上的坐标$(x,y)$并填充颜色,也可以视为两个方程,$f(i,n)$定位屏幕上需要采样的位置$(x_f,y_f)$,第二个方程计算填充的颜色</p>
|
||
<p>$w_i:$每个采样点所占的权重,通常为uniform形式,由外界输入</p>
|
||
<h6 id="supersamping-antialiasing-ssaa-超采样抗锯齿"><a href="#supersamping-antialiasing-ssaa-超采样抗锯齿" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>Supersamping Antialiasing (SSAA) 超采样抗锯齿</h6>
|
||
<p>在每一个像素里计算多个采样的算法往往被称为超采样(supersample)或过采样(oversample)</p>
|
||
<p>SSAA又被称为全屏幕抗锯齿(full-screen antialiasing,FSAA),也叫超采样抗锯齿(supersampling antialiasing,SSAA)</p>
|
||
<p>主要在于渲染比目标分辨率大的图像后,过滤邻近的像素点来采样至目标分辨率</p>
|
||
<p>例如:</p>
|
||
<p>当目标图像分辨率为1280$\times$1024时,渲染2560$\times$2048的图像后进行2$\times$2像素的采样,得到目标图像</p>
|
||
<p>劣势:</p>
|
||
<p>性能开销大,每次都需要对子样本进行完整的包含深度测试的采样,当然也可以减少采样点($2\times1或1\times2$)来减少部分开销</p>
|
||
<p>与超采样相关的累计缓存(accumulation buffer)也可以起到减少开销的作用,主要在于使用一个与生成图像分辨率相同的buffer,但每个通道中有更多的颜色bit</p>
|
||
<p>例如在采样的像素为$2\times2$的情况下,会生成4张图像且每张图都会在X或Y轴上偏移半个像素的距离使得输出像素的采样点正好对应图像的像素点中心</p>
|
||
<p>优势:</p>
|
||
<p>实现方式简单,只需要一个高分辨率图像和box filter就可以实现</p>
|
||
<p>下图是采样点在像素点内位置类型
|
||
<img src="../../images/sample_point_position.png" alt=""></p>
|
||
<p>案例:NAVIDIA's DSR(dynamic super resolution)</p>
|
||
<p>渲染4k的图像利用13个采样点的高斯滤波采样回1080p提升画面细节</p>
|
||
<hr>
|
||
<h6 id="msaamultisampling-antialiasing"><a href="#msaamultisampling-antialiasing" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>MSAA(Multisampling antialiasing)</h6>
|
||
<p>MSAA同样在一个像素中设置多个采样点,在光栅化时计算三角形在像素内对采样点的覆盖率,之后只计算每个片元的像素着色器,采样中心点的位置计算颜色信息再乘上覆盖率,最后输出这个像素的颜色</p>
|
||
<p>颜色计算与深度判断
|
||
<img src="../../images/MSAA.png" alt=""></p>
|
||
<p>总体流程如下
|
||
<img src="../../images/MSAA_sample.png" alt="">
|
||
<img src="../../images/MSAA_color.png" alt=""></p>
|
||
<p>与SSAA不同的是,MSAA只对每个像素计算一次采样,而非对整个图像进行渲染,但计算量依旧倍增</p>
|
||
<hr>
|
||
<h6 id="csaacoverage-sampling-antialiasing-and-eqaaenhanced-quality-antialiasing"><a href="#csaacoverage-sampling-antialiasing-and-eqaaenhanced-quality-antialiasing" class="anchor-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon anchor-icon"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg></a>CSAA(coverage sampling antialiasing) and EQAA(enhanced quality antialiasing)</h6>
|
||
<p>两者前后分别在2006年由NVIDIA和AMD先后提出</p>
|
||
<p>两种技术都通过提前存储片元的平均效果来提高采样率</p>
|
||
<p>例如,EQAA在2f4x模式下,会对每四个采样点计算并通过表的形式存储颜色和深度值(如下图),这使得四个采样点只需1bit空间就可以确认像素位置的着色颜色值</p>
|
||
<p><img src="../../images/EQAA_color_table.png" alt=""></p>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</article>
|
||
|
||
|
||
|
||
|
||
<div class="updated-badge-container">
|
||
<span title="Updated @ 2023-06-18 21:19:01 CST" style="cursor:help">
|
||
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="130" height="20" class="updated-badge"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="130" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path class="updated-badge-left" d="M0 0h55v20H0z"/><path class="updated-badge-right" d="M55 0h75v20H55z"/><path fill="url(#b)" d="M0 0h130v20H0z"/></g><g fill="#fff" text-anchor="middle" font-size="110"><text x="285" y="150" fill="#010101" fill-opacity=".3" textLength="450" transform="scale(.1)">updated</text><text x="285" y="140" textLength="450" transform="scale(.1)">updated</text><text x="915" y="150" fill="#010101" fill-opacity=".3" textLength="650" transform="scale(.1)">2023-06-18</text><text x="915" y="140" textLength="650" transform="scale(.1)">2023-06-18</text></g></svg>
|
||
</span></div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<ul class="post-nav">
|
||
|
||
<li class="post-nav-prev">
|
||
<a href="/computergraphic/taa/" rel="prev">< TAA(temporal antialiasing)</a>
|
||
</li>
|
||
|
||
|
||
<li class="post-nav-next">
|
||
<a href="/computergraphic/%E9%87%87%E6%A0%B7%E4%B8%8E%E5%85%89%E6%A0%85%E5%8C%96/" rel="next">采样与光栅化 ></a>
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</main>
|
||
|
||
|
||
|
||
<div id="back-to-top" class="back-to-top">
|
||
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="icon arrow-up"><path d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"/></svg></a>
|
||
</div>
|
||
|
||
|
||
|
||
<footer id="footer" class="footer">
|
||
<div class="footer-inner">
|
||
<div class="site-info">© 2022–2023 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon footer-icon"><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"/></svg> InkSoul</div><div class="powered-by">Powered by <a href="https://github.com/gohugoio/hugo" target="_blank" rel="noopener">Hugo</a> | Theme is <a href="https://github.com/reuixiy/hugo-theme-meme" target="_blank" rel="noopener">MemE</a></div><div class="site-copyright"><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" target="_blank" rel="noopener">CC BY-NC-SA 4.0</a></div><div class="custom-footer"><a href="https://beian.miit.gov.cn" target="_blank" rel="noopener">闽ICP备2022009452号-1</a></div>
|
||
|
||
|
||
|
||
<ul class="socials"><li class="socials-item">
|
||
<a href="mailto:qingci30@163.com" target="_blank" rel="external noopener" title="Email"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="icon social-icon"><path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"/></svg></a>
|
||
</li><li class="socials-item">
|
||
<a href="https://github.com/ink-soul" target="_blank" rel="external noopener" title="GitHub"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon social-icon"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>
|
||
</li><li class="socials-item">
|
||
<a href="http://gitea.inksoul.top/inksoul" target="_blank" rel="external noopener" title="gitea"><svg class="icon social-icon" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.209 4.603c-.247 0-.525.02-.84.088-.333.07-1.28.283-2.054 1.027C-.403 7.25.035 9.685.089 10.052c.065.446.263 1.687 1.21 2.768 1.749 2.141 5.513 2.092 5.513 2.092s.462 1.103 1.168 2.119c.955 1.263 1.936 2.248 2.89 2.367 2.406 0 7.212-.004 7.212-.004s.458.004 1.08-.394c.535-.324 1.013-.893 1.013-.893s.492-.527 1.18-1.73c.21-.37.385-.729.538-1.068 0 0 2.107-4.471 2.107-8.823-.042-1.318-.367-1.55-.443-1.627-.156-.156-.366-.153-.366-.153s-4.475.252-6.792.306c-.508.011-1.012.023-1.512.027v4.474l-.634-.301c0-1.39-.004-4.17-.004-4.17-1.107.016-3.405-.084-3.405-.084s-5.399-.27-5.987-.324c-.187-.011-.401-.032-.648-.032zm.354 1.832h.111s.271 2.269.6 3.597C5.549 11.147 6.22 13 6.22 13s-.996-.119-1.641-.348c-.99-.324-1.409-.714-1.409-.714s-.73-.511-1.096-1.52C1.444 8.73 2.021 7.7 2.021 7.7s.32-.859 1.47-1.145c.395-.106.863-.12 1.072-.12zm8.33 2.554c.26.003.509.127.509.127l.868.422-.529 1.075a.686.686 0 0 0-.614.359.685.685 0 0 0 .072.756l-.939 1.924a.69.69 0 0 0-.66.527.687.687 0 0 0 .347.763.686.686 0 0 0 .867-.206.688.688 0 0 0-.069-.882l.916-1.874a.667.667 0 0 0 .237-.02.657.657 0 0 0 .271-.137 8.826 8.826 0 0 1 1.016.512.761.761 0 0 1 .286.282c.073.21-.073.569-.073.569-.087.29-.702 1.55-.702 1.55a.692.692 0 0 0-.676.477.681.681 0 1 0 1.157-.252c.073-.141.141-.282.214-.431.19-.397.515-1.16.515-1.16.035-.066.218-.394.103-.814-.095-.435-.48-.638-.48-.638-.467-.301-1.116-.58-1.116-.58s0-.156-.042-.27a.688.688 0 0 0-.148-.241l.516-1.062 2.89 1.401s.48.218.583.619c.073.282-.019.534-.069.657-.24.587-2.1 4.317-2.1 4.317s-.232.554-.748.588a1.065 1.065 0 0 1-.393-.045l-.202-.08-4.31-2.1s-.417-.218-.49-.596c-.083-.31.104-.691.104-.691l2.073-4.272s.183-.37.466-.497a.855.855 0 0 1 .35-.077z" ></path></svg></a>
|
||
</li><li class="socials-item">
|
||
<a href="https://space.bilibili.com/262369930" target="_blank" rel="external noopener" title="bilibili"><svg class="icon social-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.813 4.653h.854c1.51.054 2.769.578 3.773 1.574 1.004.995 1.524 2.249 1.56 3.76v7.36c-.036 1.51-.556 2.769-1.56 3.773s-2.262 1.524-3.773 1.56H5.333c-1.51-.036-2.769-.556-3.773-1.56S.036 18.858 0 17.347v-7.36c.036-1.511.556-2.765 1.56-3.76 1.004-.996 2.262-1.52 3.773-1.574h.774l-1.174-1.12a1.234 1.234 0 0 1-.373-.906c0-.356.124-.658.373-.907l.027-.027c.267-.249.573-.373.92-.373.347 0 .653.124.92.373L9.653 4.44c.071.071.134.142.187.213h4.267a.836.836 0 0 1 .16-.213l2.853-2.747c.267-.249.573-.373.92-.373.347 0 .662.151.929.4.267.249.391.551.391.907 0 .355-.124.657-.373.906zM5.333 7.24c-.746.018-1.373.276-1.88.773-.506.498-.769 1.13-.786 1.894v7.52c.017.764.28 1.395.786 1.893.507.498 1.134.756 1.88.773h13.334c.746-.017 1.373-.275 1.88-.773.506-.498.769-1.129.786-1.893v-7.52c-.017-.765-.28-1.396-.786-1.894-.507-.497-1.134-.755-1.88-.773zM8 11.107c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c0-.373.129-.689.386-.947.258-.257.574-.386.947-.386zm8 0c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c.017-.391.15-.711.4-.96.249-.249.56-.373.933-.373Z"/></svg></a>
|
||
</li></ul>
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</footer>
|
||
|
||
|
||
</div>
|
||
<script>
|
||
if ('serviceWorker' in navigator) {
|
||
window.addEventListener('load', function() {
|
||
navigator.serviceWorker.register('\/sw.js');
|
||
});
|
||
}
|
||
</script>
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.css" integrity="sha256-gPJfuwTULrEAAcI3X4bALVU/2qBU+QY/TpoD3GO+Exw=" crossorigin="anonymous">
|
||
|
||
<script>
|
||
if (typeof renderMathInElement === 'undefined') {
|
||
var getScript = (options) => {
|
||
var script = document.createElement('script');
|
||
script.defer = true;
|
||
script.crossOrigin = 'anonymous';
|
||
Object.keys(options).forEach((key) => {
|
||
script[key] = options[key];
|
||
});
|
||
document.body.appendChild(script);
|
||
};
|
||
getScript({
|
||
src: 'https:\/\/fastly.jsdelivr.net/npm/katex@0.13.0/dist/katex.min.js',
|
||
integrity: 'sha256-YTW9cMncW/ZQMhY69KaUxIa2cPTxV87Uh627Gf5ODUw=',
|
||
onload: () => {
|
||
getScript({
|
||
src: 'https:\/\/fastly.jsdelivr.net/npm/katex@0.13.0/dist/contrib/mhchem.min.js',
|
||
integrity: 'sha256-yzSfYeVsWJ1x+2g8CYHsB/Mn7PcSp8122k5BM4T3Vxw=',
|
||
onload: () => {
|
||
getScript({
|
||
src: 'https:\/\/fastly.jsdelivr.net/npm/katex@0.13.0/dist/contrib/auto-render.min.js',
|
||
integrity: 'sha256-fxJzNV6hpc8tgW8tF0zVobKa71eTCRGTgxFXt1ZpJNM=',
|
||
onload: () => {
|
||
renderKaTex();
|
||
}
|
||
});
|
||
}
|
||
});
|
||
}
|
||
});
|
||
} else {
|
||
renderKaTex();
|
||
}
|
||
function renderKaTex() {
|
||
renderMathInElement(
|
||
document.body,
|
||
{
|
||
delimiters: [
|
||
{left: "$$", right: "$$", display: true},
|
||
{left: "\\[", right: "\\]", display: true},
|
||
{left: "$", right: "$", display: false},
|
||
{left: "\\(", right: "\\)", display: false}
|
||
]
|
||
}
|
||
);
|
||
}
|
||
</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<script src="https://fastly.jsdelivr.net/npm/medium-zoom@latest/dist/medium-zoom.min.js"></script>
|
||
|
||
<script>
|
||
let imgNodes = document.querySelectorAll('div.post-body img');
|
||
imgNodes = Array.from(imgNodes).filter(node => node.parentNode.tagName !== "A");
|
||
|
||
mediumZoom(imgNodes, {
|
||
background: 'hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0.95)'
|
||
})
|
||
</script>
|
||
|
||
|
||
|
||
|
||
<script src="https://fastly.jsdelivr.net/npm/instant.page@5.1.0/instantpage.min.js" type="module" defer></script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html>
|