alias.html

来自「Visual C++ has been one of most effectiv」· HTML 代码 · 共 51 行

HTML
51
字号
<html>
<head>
    <title>Texture mapping</title>
    <link rel="stylesheet" href="rs-2.css" tppabs="http://www.relisoft.com/games/rs.css">
</head>

<body background="margin-2.gif" tppabs="http://www.relisoft.com/games/images/margin.gif" bgcolor="#FFFFDC">

<!-- Main Table -->
<table cellpadding="6">
    <tr>
    <td width="78">    &nbsp; </td>
    <td width="600">


<h1>Texture Aliasing Problems</h1>
<p>Texture is usually stored as a bitmap. A bitmap contains a finite number of discrete samples of some original image. During scan conversion of a textured polygon, pixel coordinates are mapped into texture coordinates (u, v) and the texture is re-sampled using these coordinates. In particular, if the polygon is shrunk due to perspective, it will cover only a few pixels. This will result in just a few sampling points spread across the texture bitmap.

<p><img src="Sampling.gif" tppabs="http://www.relisoft.com/games/Images/Sampling.gif" width=375 height=174 border=0 alt="Texture resampling">
<p class="caption">Fig 1. On the left, a polygon is being scan-converted. Interpolation gives us the texture (u, v) coordinates for each pixel. These coordinates are then used to access (re-sample) the texture on the right.
<p>If the texture contains a lot of fine detail, the re-sampling points might not be representative of the particular area of the bitmap. 
<p>Below, the picture on the right is the result of picking every 5th pixel from the picture on the left. Notice random white pixels when the sampling point fell on white tracks. The tracks correspond to a high-frequency component of the picture--large variations of color concentrated in small areas. Since the width of the tracks is less than 5 pixels, the samples often miss the tracks completely, at other times exaggerate their width. Sampling of an image that has high-frequency components with a grid of lower frequency results in <b>aliasing artifacts</b>.
<p>
<table border="3">
<tr>
<td><img src="silesia1.gif" tppabs="http://www.relisoft.com/games/Images/silesia1.gif" width=294 height=199 border=0 alt="Original bitmap"></td>
<td><img src="silesia5.gif" tppabs="http://www.relisoft.com/games/Images/silesia5.gif" width=295 height=200 border=0 alt="Resampled bitmap"></td>
</tr>
</table>
<p class="caption">Fig 2. Re-sampling of a picture resulting in heavy aliasing.

<p>On the left, this is the same picture after applying a 5x5 box filter. The resampling on the right (again, every 5th pixel) results in a much smoother picture. Filtering smoothed out high frequency components. For instance, the tracks are much less sharp than in the previous picture.
<p>
<table border="3">
<tr>
<td><img src="silesia5box.gif" tppabs="http://www.relisoft.com/games/Images/silesia5box.gif" width=294 height=199 border=0 alt="Box-filtered picture"></td>
<td><img src="silesia5box5.gif" tppabs="http://www.relisoft.com/games/Images/silesia5box5.gif" width=295 height=200 border=0 alt="Resampling after box-filtering"></td>
</tr>
</table>
<p class="caption">Fig 3. The re-sampling of a pre-filtered image produces much less aliasing.

<p>Applying a box filter is equivalent to averaging out a square of 5x5 pixels for each pixel of the resulting picture. 
<p>Next: <a href="javascript:if(confirm('http://www.relisoft.com/games/filter.html  \n\nThis file was not retrieved by Teleport Pro, because it is linked too far away from its Starting Address. If you increase the in-domain depth setting for the Starting Address, this file will be queued for retrieval.  \n\nDo you want to open it from the server?'))window.location='http://www.relisoft.com/games/filter.html'" tppabs="http://www.relisoft.com/games/filter.html">More about filtering.</a>


    </td></tr>
</table>
<!-- End Main Table -->
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?