<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Game Rendering &#187; Filtering</title>
	<atom:link href="http://www.gamerendering.com/category/image-enhancements/filtering-image-enhancements/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gamerendering.com</link>
	<description></description>
	<lastBuildDate>Thu, 21 Jan 2010 01:32:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bilinear Interpolation</title>
		<link>http://www.gamerendering.com/2008/10/05/bilinear-interpolation/</link>
		<comments>http://www.gamerendering.com/2008/10/05/bilinear-interpolation/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 15:18:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Filtering]]></category>
		<category><![CDATA[Bilinear Interpolation]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[Fragment Shader]]></category>
		<category><![CDATA[GLSL]]></category>
		<category><![CDATA[Interpolation]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Vertex Shader]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=229</guid>
		<description><![CDATA[When sampling a texel from a texture that has been re-sized (which is nearly always the case in 3D rendering) you need to use some kind of filter to select what result you should get. Bilinear interpolation uses the four nearest neighbors to interpolate an average texel value.


This is a built in filter in OpenGL and to activate [...]]]></description>
			<content:encoded><![CDATA[<p>When sampling a texel from a texture that has been re-sized (which is nearly always the case in 3D rendering) you need to use some kind of filter to select what result you should get. Bilinear interpolation uses the four nearest neighbors to interpolate an average texel value.</p>
<p><a href="http://www.gamerendering.com/wp-content/uploads/bilinearinterpolation.jpg"></a></p>
<div class="mceTemp"><a href="http://www.gamerendering.com/wp-content/uploads/bilinearinterpolation1.jpg"><img class="size-full wp-image-231" title="Bilinear Interpolation" src="http://www.gamerendering.com/wp-content/uploads/bilinearinterpolation1.jpg" alt="Bilinear Interpolation" width="421" height="126" /></a></div>
<p>This is a built in filter in OpenGL and to activate it you set the following lines when setting up a texture:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2293"><td class="code" id="p229code3"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// set the minification filter</span>
glTexParameterf<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D<span style="color: #339933;">,</span> GL_TEXTURE_MIN_FILTER<span style="color: #339933;">,</span> GL_LINEAR_MIPMAP_NEAREST <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// set the magnification filter</span>
glTexParameterf<span style="color: #009900;">&#40;</span> GL_TEXTURE_2D<span style="color: #339933;">,</span> GL_TEXTURE_MAG_FILTER<span style="color: #339933;">,</span> GL_LINEAR <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>If you for some reason wants to do bilinear interpolation manually in a shader then the function to do so looks like the following in GLSL. Note that in vertex shaders you have to do manual bilinear interpolation between texture samples.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2294"><td class="code" id="p229code4"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">const</span> <span style="color: #993333;">float</span> textureSize <span style="color: #339933;">=</span> <span style="color:#800080;">512.0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//size of the texture</span>
<span style="color: #993333;">const</span> <span style="color: #993333;">float</span> texelSize <span style="color: #339933;">=</span> <span style="color:#800080;">1.0</span> <span style="color: #339933;">/</span> textureSize<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//size of one texel </span>
&nbsp;
vec4 texture2DBilinear<span style="color: #009900;">&#40;</span> sampler2D textureSampler<span style="color: #339933;">,</span> vec2 uv <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// in vertex shaders you should use texture2DLod instead of texture2D</span>
    vec4 tl <span style="color: #339933;">=</span> texture2D<span style="color: #009900;">&#40;</span>textureSampler<span style="color: #339933;">,</span> uv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    vec4 tr <span style="color: #339933;">=</span> texture2D<span style="color: #009900;">&#40;</span>textureSampler<span style="color: #339933;">,</span> uv <span style="color: #339933;">+</span> vec2<span style="color: #009900;">&#40;</span>texelSize<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    vec4 bl <span style="color: #339933;">=</span> texture2D<span style="color: #009900;">&#40;</span>textureSampler<span style="color: #339933;">,</span> uv <span style="color: #339933;">+</span> vec2<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> texelSize<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    vec4 br <span style="color: #339933;">=</span> texture2D<span style="color: #009900;">&#40;</span>textureSampler<span style="color: #339933;">,</span> uv <span style="color: #339933;">+</span> vec2<span style="color: #009900;">&#40;</span>texelSize <span style="color: #339933;">,</span> texelSize<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    vec2 f <span style="color: #339933;">=</span> fract<span style="color: #009900;">&#40;</span> uv.<span style="color: #202020;">xy</span> <span style="color: #339933;">*</span> textureSize <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get the decimal part</span>
    vec4 tA <span style="color: #339933;">=</span> mix<span style="color: #009900;">&#40;</span> tl<span style="color: #339933;">,</span> tr<span style="color: #339933;">,</span> f.<span style="color: #202020;">x</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will interpolate the red dot in the image</span>
    vec4 tB <span style="color: #339933;">=</span> mix<span style="color: #009900;">&#40;</span> bl<span style="color: #339933;">,</span> br<span style="color: #339933;">,</span> f.<span style="color: #202020;">x</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will interpolate the blue dot in the image</span>
    <span style="color: #b1b100;">return</span> mix<span style="color: #009900;">&#40;</span> tA<span style="color: #339933;">,</span> tB<span style="color: #339933;">,</span> f.<span style="color: #202020;">y</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// will interpolate the green dot in the image</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here&#8217;s a magnification of a texture using using three different types of filters. The texture is mapped on a sphere and the viewport has been zoomed in on a small part of it.</p>
<p>Nearest Neigbour  (OpenGL fixed function implementation)</p>
<div class="mceTemp"><a href="http://www.gamerendering.com/wp-content/uploads/nearestneigbor.jpg"><img class="size-medium wp-image-245" title="Nearest Neigbor filter" src="http://www.gamerendering.com/wp-content/uploads/nearestneigbor.jpg" alt="Nearest Neigbor filter" width="216" height="185" /></a></div>
<p>Bilinear Interpolation (OpenGL fixed function implementation)</p>
<div class="mceTemp"><a href="http://www.gamerendering.com/wp-content/uploads/bilinearfilteringfixed.jpg"><img class="size-medium wp-image-246" title="Bilinear Interpolation OpenGL" src="http://www.gamerendering.com/wp-content/uploads/bilinearfilteringfixed.jpg" alt="Bilinear Interpolation OpenGL" width="214" height="184" /></a></div>
<p>Bilinear Interpolation (GLSL implementation, the code above)</p>
<div class="mceTemp"><a href="http://www.gamerendering.com/wp-content/uploads/bilinearmanually.jpg"><img class="size-medium wp-image-247" title="Bilinear Interpolation GLSL" src="http://www.gamerendering.com/wp-content/uploads/bilinearmanually.jpg" alt="Bilinear Interpolation GLSL" width="216" height="187" /></a></div>
<p>Some information about OpenGL texture mapping and how to set the filtering properties:<br />
<a href="http://www.nullterminator.net/gltexture.html">http://www.nullterminator.net/gltexture.html</a></p>
<p>Here&#8217;s some discussion why you should not always use bilinear interpolation:<br />
<a href="http://gregs-blog.com/2008/01/14/how-to-turn-off-bilinear-filtering-in-opengl/">http://gregs-blog.com/2008/01/14/how-to-turn-off-bilinear-filtering-in-opengl/</a></p>
<p>Link to a bilinear interpolation function for DirectX:<br />
<a href="http://www.catalinzima.com/?page_id=85">http://www.catalinzima.com/?page_id=85</a></p>
<p>Article on GameDev.net about bilinear filtering:<br />
<a href="http://www.gamedev.net/reference/articles/article669.asp">http://www.gamedev.net/reference/articles/article669.asp</a></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Please share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow" id="print" href="javascript:window.location='http%3A%2F%2Fwww.printfriendly.com%2Fprint%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Bpartner%3Dsociable';" title="Print this article!"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation%26amp%3Bbodytext%3DWhen%2520sampling%2520a%2520texel%2520from%2520a%2520texture%2520that%2520has%2520been%2520re-sized%2520%2528which%2520is%2520nearly%25C2%25A0always%2520the%2520case%2520in%25C2%25A03D%2520rendering%2529%25C2%25A0you%2520need%2520to%2520use%2520some%2520kind%2520of%2520filter%2520to%2520select%2520what%2520result%2520you%2520should%2520get.%2520Bilinear%2520interpolation%2520uses%2520the%2520four%2520nearest%2520neighbors%2520to%2520inter';" title="Digg"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="sphinn" href="javascript:window.location='http%3A%2F%2Fsphinn.com%2Findex.php%3Fc%3Dpost%26m%3Dsubmit%26link%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F';" title="Sphinn"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation%26amp%3Bnotes%3DWhen%2520sampling%2520a%2520texel%2520from%2520a%2520texture%2520that%2520has%2520been%2520re-sized%2520%2528which%2520is%2520nearly%25C2%25A0always%2520the%2520case%2520in%25C2%25A03D%2520rendering%2529%25C2%25A0you%2520need%2520to%2520use%2520some%2520kind%2520of%2520filter%2520to%2520select%2520what%2520result%2520you%2520should%2520get.%2520Bilinear%2520interpolation%2520uses%2520the%2520four%2520nearest%2520neighbors%2520to%2520inter';" title="del.icio.us"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Bt%3DBilinear%2520Interpolation';" title="Facebook"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx" href="javascript:window.location='http%3A%2F%2Fwww.mixx.com%2Fsubmit%3Fpage_url%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation';" title="Mixx"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="google" href="javascript:window.location='http%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26amp%3Bbkmk%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation%26amp%3Bannotation%3DWhen%2520sampling%2520a%2520texel%2520from%2520a%2520texture%2520that%2520has%2520been%2520re-sized%2520%2528which%2520is%2520nearly%25C2%25A0always%2520the%2520case%2520in%25C2%25A03D%2520rendering%2529%25C2%25A0you%2520need%2520to%2520use%2520some%2520kind%2520of%2520filter%2520to%2520select%2520what%2520result%2520you%2520should%2520get.%2520Bilinear%2520interpolation%2520uses%2520the%2520four%2520nearest%2520neighbors%2520to%2520inter';" title="Google Bookmarks"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="current" href="javascript:window.location='http%3A%2F%2Fcurrent.com%2Fclipper.htm%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation';" title="Current"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="linkedin" href="javascript:window.location='http%3A%2F%2Fwww.linkedin.com%2FshareArticle%3Fmini%3Dtrue%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation%26amp%3Bsource%3DGame%2BRendering%2B%26amp%3Bsummary%3DWhen%2520sampling%2520a%2520texel%2520from%2520a%2520texture%2520that%2520has%2520been%2520re-sized%2520%2528which%2520is%2520nearly%25C2%25A0always%2520the%2520case%2520in%25C2%25A03D%2520rendering%2529%25C2%25A0you%2520need%2520to%2520use%2520some%2520kind%2520of%2520filter%2520to%2520select%2520what%2520result%2520you%2520should%2520get.%2520Bilinear%2520interpolation%2520uses%2520the%2520four%2520nearest%2520neighbors%2520to%2520inter';" title="LinkedIn"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="live" href="javascript:window.location='https%3A%2F%2Ffavorites.live.com%2Fquickadd.aspx%3Fmarklet%3D1%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation';" title="Live"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="myspace" href="javascript:window.location='http%3A%2F%2Fwww.myspace.com%2FModules%2FPostTo%2FPages%2F%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Bt%3DBilinear%2520Interpolation';" title="MySpace"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="netvibes" href="javascript:window.location='http%3A%2F%2Fwww.netvibes.com%2Fshare%3Ftitle%3DBilinear%2520Interpolation%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F';" title="Netvibes"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon" href="javascript:window.location='http%3A%2F%2Fwww.stumbleupon.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation';" title="StumbleUpon"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="twitter" href="javascript:window.location='http%3A%2F%2Ftwitter.com%2Fhome%3Fstatus%3DBilinear%2520Interpolation%2520-%2520http%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F';" title="Twitter"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit" href="javascript:window.location='http%3A%2F%2Freddit.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Btitle%3DBilinear%2520Interpolation';" title="Reddit"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati" href="javascript:window.location='http%3A%2F%2Ftechnorati.com%2Ffaves%3Fadd%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F';" title="Technorati"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="yahoo! bookmarks" href="javascript:window.location='http%3A%2F%2Fbookmarks.yahoo.com%2Ftoolbar%2Fsavebm%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F10%252F05%252Fbilinear-interpolation%252F%26amp%3Bt%3DBilinear%2520Interpolation%26opener%3Dbm%26amp%3Bei%3DUTF-8%26amp%3Bd%3DWhen%2520sampling%2520a%2520texel%2520from%2520a%2520texture%2520that%2520has%2520been%2520re-sized%2520%2528which%2520is%2520nearly%25C2%25A0always%2520the%2520case%2520in%25C2%25A03D%2520rendering%2529%25C2%25A0you%2520need%2520to%2520use%2520some%2520kind%2520of%2520filter%2520to%2520select%2520what%2520result%2520you%2520should%2520get.%2520Bilinear%2520interpolation%2520uses%2520the%2520four%2520nearest%2520neighbors%2520to%2520inter';" title="Yahoo! Bookmarks"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2008/10/05/bilinear-interpolation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multisampling (Supersampling)</title>
		<link>http://www.gamerendering.com/2008/09/26/multisampling-supersampling/</link>
		<comments>http://www.gamerendering.com/2008/09/26/multisampling-supersampling/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 17:35:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Filtering]]></category>
		<category><![CDATA[Antialiasing]]></category>
		<category><![CDATA[Multisampling]]></category>
		<category><![CDATA[Real-Time Rendering]]></category>
		<category><![CDATA[Supersampling]]></category>
		<category><![CDATA[Triangle]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=112</guid>
		<description><![CDATA[Because every pixel is normally only sampled once they cannot get the correct output if the whole pixel isn&#8217;t covered by one triangle. This is beacuse the sample can only get it&#8217;s colour (and other properties) from one triangle. In the contour of a model this is very apparent and if no multisampling is enabled then [...]]]></description>
			<content:encoded><![CDATA[<p>Because every pixel is normally only sampled once they cannot get the correct output if the whole pixel isn&#8217;t covered by one triangle. This is beacuse the sample can only get it&#8217;s colour (and other properties) from one triangle. In the contour of a model this is very apparent and if no multisampling is enabled then the edges will be jagged and appear very annoing. This effect is called aliasing and to deal with it we would need unlimited with samples in the pixel and blend them together, but it&#8217;s not possible with the current hardware. Instead we have to accept only taking two, four or more samples and hope it&#8217;s enough. There are a lot of different methods to do multisampling and the table below show some of the most used ones and the result from using them on a filled triangle and a outlined triangle.</p>
<p><img class="size-full wp-image-113" title="Supersampling Schemes" src="http://www.gamerendering.com/wp-content/uploads/supersamplingschemes.gif" alt="Supersampling Schemes" width="316" height="406" /></p>
<p><em>Image from the book <a title="Real-Time Rendering" href="http://www.realtimerendering.com">Real-Time Rendering</a>, used with permission.</em></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Please share:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow" id="print" href="javascript:window.location='http%3A%2F%2Fwww.printfriendly.com%2Fprint%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Bpartner%3Dsociable';" title="Print this article!"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print this article!" alt="Print this article!" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="digg" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529%26amp%3Bbodytext%3DBecause%2520every%2520pixel%2520is%2520normally%2520only%2520sampled%2520once%2520they%2520cannot%2520get%2520the%2520correct%2520output%2520if%2520the%2520whole%2520pixel%2520isn%2527t%2520covered%2520by%2520one%2520triangle.%2520This%2520is%2520beacuse%2520the%2520sample%2520can%2520only%2520get%2520it%2527s%2520colour%2520%2528and%2520other%2520properties%2529%25C2%25A0from%2520one%2520triangle.%2520In%2520the%2520contour%2520of%2520a%2520';" title="Digg"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="sphinn" href="javascript:window.location='http%3A%2F%2Fsphinn.com%2Findex.php%3Fc%3Dpost%26m%3Dsubmit%26link%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F';" title="Sphinn"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="del.icio.us" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529%26amp%3Bnotes%3DBecause%2520every%2520pixel%2520is%2520normally%2520only%2520sampled%2520once%2520they%2520cannot%2520get%2520the%2520correct%2520output%2520if%2520the%2520whole%2520pixel%2520isn%2527t%2520covered%2520by%2520one%2520triangle.%2520This%2520is%2520beacuse%2520the%2520sample%2520can%2520only%2520get%2520it%2527s%2520colour%2520%2528and%2520other%2520properties%2529%25C2%25A0from%2520one%2520triangle.%2520In%2520the%2520contour%2520of%2520a%2520';" title="del.icio.us"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="facebook" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Bt%3DMultisampling%2520%2528Supersampling%2529';" title="Facebook"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="mixx" href="javascript:window.location='http%3A%2F%2Fwww.mixx.com%2Fsubmit%3Fpage_url%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529';" title="Mixx"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="google" href="javascript:window.location='http%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26amp%3Bbkmk%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529%26amp%3Bannotation%3DBecause%2520every%2520pixel%2520is%2520normally%2520only%2520sampled%2520once%2520they%2520cannot%2520get%2520the%2520correct%2520output%2520if%2520the%2520whole%2520pixel%2520isn%2527t%2520covered%2520by%2520one%2520triangle.%2520This%2520is%2520beacuse%2520the%2520sample%2520can%2520only%2520get%2520it%2527s%2520colour%2520%2528and%2520other%2520properties%2529%25C2%25A0from%2520one%2520triangle.%2520In%2520the%2520contour%2520of%2520a%2520';" title="Google Bookmarks"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="current" href="javascript:window.location='http%3A%2F%2Fcurrent.com%2Fclipper.htm%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529';" title="Current"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/current.png" title="Current" alt="Current" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="linkedin" href="javascript:window.location='http%3A%2F%2Fwww.linkedin.com%2FshareArticle%3Fmini%3Dtrue%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529%26amp%3Bsource%3DGame%2BRendering%2B%26amp%3Bsummary%3DBecause%2520every%2520pixel%2520is%2520normally%2520only%2520sampled%2520once%2520they%2520cannot%2520get%2520the%2520correct%2520output%2520if%2520the%2520whole%2520pixel%2520isn%2527t%2520covered%2520by%2520one%2520triangle.%2520This%2520is%2520beacuse%2520the%2520sample%2520can%2520only%2520get%2520it%2527s%2520colour%2520%2528and%2520other%2520properties%2529%25C2%25A0from%2520one%2520triangle.%2520In%2520the%2520contour%2520of%2520a%2520';" title="LinkedIn"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="live" href="javascript:window.location='https%3A%2F%2Ffavorites.live.com%2Fquickadd.aspx%3Fmarklet%3D1%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529';" title="Live"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="myspace" href="javascript:window.location='http%3A%2F%2Fwww.myspace.com%2FModules%2FPostTo%2FPages%2F%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Bt%3DMultisampling%2520%2528Supersampling%2529';" title="MySpace"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="netvibes" href="javascript:window.location='http%3A%2F%2Fwww.netvibes.com%2Fshare%3Ftitle%3DMultisampling%2520%2528Supersampling%2529%26amp%3Burl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F';" title="Netvibes"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="stumbleupon" href="javascript:window.location='http%3A%2F%2Fwww.stumbleupon.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529';" title="StumbleUpon"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="twitter" href="javascript:window.location='http%3A%2F%2Ftwitter.com%2Fhome%3Fstatus%3DMultisampling%2520%2528Supersampling%2529%2520-%2520http%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F';" title="Twitter"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="reddit" href="javascript:window.location='http%3A%2F%2Freddit.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Btitle%3DMultisampling%2520%2528Supersampling%2529';" title="Reddit"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" id="technorati" href="javascript:window.location='http%3A%2F%2Ftechnorati.com%2Ffaves%3Fadd%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F';" title="Technorati"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow" id="yahoo! bookmarks" href="javascript:window.location='http%3A%2F%2Fbookmarks.yahoo.com%2Ftoolbar%2Fsavebm%3Fu%3Dhttp%253A%252F%252Fwww.gamerendering.com%252F2008%252F09%252F26%252Fmultisampling-supersampling%252F%26amp%3Bt%3DMultisampling%2520%2528Supersampling%2529%26opener%3Dbm%26amp%3Bei%3DUTF-8%26amp%3Bd%3DBecause%2520every%2520pixel%2520is%2520normally%2520only%2520sampled%2520once%2520they%2520cannot%2520get%2520the%2520correct%2520output%2520if%2520the%2520whole%2520pixel%2520isn%2527t%2520covered%2520by%2520one%2520triangle.%2520This%2520is%2520beacuse%2520the%2520sample%2520can%2520only%2520get%2520it%2527s%2520colour%2520%2528and%2520other%2520properties%2529%25C2%25A0from%2520one%2520triangle.%2520In%2520the%2520contour%2520of%2520a%2520';" title="Yahoo! Bookmarks"><img src="http://www.gamerendering.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2008/09/26/multisampling-supersampling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
