<?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</title>
	<atom:link href="http://www.gamerendering.com/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>Welcome to Game Rendering!</title>
		<link>http://www.gamerendering.com/2008/09/24/welcome-to-game-rendering/</link>
		<comments>http://www.gamerendering.com/2008/09/24/welcome-to-game-rendering/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 00:03:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computer Graphics]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=14</guid>
		<description><![CDATA[While developing games I&#8217;ve been collecting lots of links to useful pages and as they increased in amount I needed some way to organize them. I realized that they might be useful for others too so I decided to create a simple website with the links and other information I&#8217;ve collected. I have just finished studying for [...]]]></description>
			<content:encoded><![CDATA[<div class="announcement_post"><p lang="en-US">While developing games I&#8217;ve been collecting lots of links to useful pages and as they increased in amount I needed some way to organize them. I realized that they might be useful for others too so I decided to create a simple website with the links and other information I&#8217;ve collected. I have just finished studying for my Master degree in Software engineering and is especially interested in computer graphics and game rendering. This site is therefore also created as a learning project for me and can therefore contain information that is incorrect somewhere. If you ever find something that&#8217;s wrong I would be happy if you informed me by commenting the site.</p>
<p lang="en-US">New articles will be posted as often I can.</p>
<p lang="en-US">I&#8217;m currently working on adding online demos for the articles so one can view the result immediately.</p>
<p lang="en-US">/ Robert</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2008/09/24/welcome-to-game-rendering/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Great free graphics programming books!</title>
		<link>http://www.gamerendering.com/2009/12/10/great-free-graphics-programming-books/</link>
		<comments>http://www.gamerendering.com/2009/12/10/great-free-graphics-programming-books/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 12:25:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[Geometry Shader]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Pixel Shader]]></category>
		<category><![CDATA[Shaders]]></category>
		<category><![CDATA[Vertex Shader]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=769</guid>
		<description><![CDATA[Here is a list of good books that all graphics programmer&#8217;s should read. They are a little dated now, but FREE!
     

       

     

    


Feel free to mention in the comments if you know other free books online.
]]></description>
			<content:encoded><![CDATA[<p>Here is a list of good books that all graphics programmer&#8217;s should read. They are a little dated now, but <strong>FREE</strong>!</p>
<p><a href="http://wiki.gamedev.net/index.php/D3DBook:Book_Cover"></a><a href="http://wiki.gamedev.net/index.php/D3DBook:Book_Cover"><img class="alignnone size-medium wp-image-785" title="Programming Vertex, Geometry, and Pixel Shaders" src="http://www.gamerendering.com/wp-content/uploads/programmingVGPS2-317x400.jpg" alt="Programming Vertex, Geometry, and Pixel Shaders" width="222" height="280" /></a>     <a href="http://tog.acm.org/resources/shaderx/Direct3D.ShaderX.Vertex.and.Pixel.Shader.Tips.and.Tricks_Wolfgang.F.Engel_Wordware.Pub_2002.pdf"><img class="size-medium wp-image-770" title="ShaderX1" src="http://www.gamerendering.com/wp-content/uploads/ShaderX1-320x400.jpg" alt="ShaderX1" width="205" height="256" /></a></p>
<div class="mceTemp"><a href="http://tog.acm.org/resources/shaderx/Direct3D.ShaderX.Vertex.and.Pixel.Shader.Tips.and.Tricks_Wolfgang.F.Engel_Wordware.Pub_2002.pdf"></a></div>
<div class="mceTemp"><a href="http://tog.acm.org/resources/shaderx/Introductions_and_Tutorials_with_DirectX_9.pdf"><img class="size-medium wp-image-771" title="ShaderX2" src="http://www.gamerendering.com/wp-content/uploads/ShaderX2-264x400.jpg" alt="ShaderX2" width="214" height="324" /></a>       <a href="http://tog.acm.org/resources/shaderx/Tips_and_Tricks_with_DirectX_9.pdf"><img class="alignnone size-full wp-image-772" title="ShaderX2" src="http://www.gamerendering.com/wp-content/uploads/ShaderX2b.jpg" alt="ShaderX2" width="200" height="301" /></a></div>
<div class="mceTemp"><a href="http://tog.acm.org/resources/shaderx/Tips_and_Tricks_with_DirectX_9.pdf"></a></div>
<div class="mceTemp"><a href="http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter01.html"><img class="alignnone size-medium wp-image-777" title="CgTutorial" src="http://www.gamerendering.com/wp-content/uploads/CgTutorial-319x400.jpg" alt="CgTutorial" width="230" height="288" /></a>     <a href="http://http.developer.nvidia.com/GPUGems/gpugems_part01.html"><img class="alignnone size-medium wp-image-778" title="GPU Gems" src="http://www.gamerendering.com/wp-content/uploads/GPUGems1-319x400.jpg" alt="GPU Gems" width="223" height="280" /></a></div>
<div class="mceTemp"><a href="http://http.developer.nvidia.com/GPUGems/gpugems_part01.html"></a></div>
<div class="mceTemp"><a href="http://http.developer.nvidia.com/GPUGems2/gpugems2_part01.html"><img class="alignnone size-medium wp-image-779" title="GPU Gems 2" src="http://www.gamerendering.com/wp-content/uploads/GPUGems2-313x400.jpg" alt="GPU Gems 2" width="200" height="256" /></a>    <a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_part01.html"><img class="alignnone size-medium wp-image-780" title="GPU Gems 3" src="http://www.gamerendering.com/wp-content/uploads/GPUGems3-317x400.jpg" alt="GPU Gems 3" width="222" height="280" /></a></div>
<div class="mceTemp"><a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_part01.html"></a></div>
<div class="mceTemp"><a href="http://www.glprogramming.com/red/"></a></div>
<div class="mceTemp"><em>Feel free to mention in the comments if you know other free books online.</em></div>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2009/12/10/great-free-graphics-programming-books/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Texture Atlas</title>
		<link>http://www.gamerendering.com/2009/12/08/texture-atlas/</link>
		<comments>http://www.gamerendering.com/2009/12/08/texture-atlas/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 11:07:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Optimizations]]></category>
		<category><![CDATA[batching]]></category>
		<category><![CDATA[mipmaps]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[Shaders]]></category>
		<category><![CDATA[Texture Atlas]]></category>
		<category><![CDATA[Texturing]]></category>
		<category><![CDATA[tiling]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=742</guid>
		<description><![CDATA[Texture atlas [1][2] is a technique to group smaller textures into a larger texture. This decreases the number of state switches [3] a renderer needs to do and therefore often increases performance. Texture atlases have been used for a long time in the video game industry for sprite animations. When using texture atlases, the uv-coordinates of [...]]]></description>
			<content:encoded><![CDATA[<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">Texture atlas [1][2] is a technique to group smaller textures into a larger texture. This decreases the number of state switches [3] a renderer needs to do and therefore often increases performance. Texture atlases have been used for a long time in the video game industry for sprite animations. When using texture atlases, the uv-coordinates of the models have to be changed so the original 0..1 map to the textures tile in the atlas. Grouping of textures can be done manually by texture artists or with tools. The texture coordinate system can be changed to map the new texture in a tool, or in the shader at run-time.</p>
<div class="mceTemp">
<dl id="attachment_743" class="wp-caption " style="width: 290px;">
<dt class="wp-caption-dt"><a href="http://www.gamerendering.com/wp-content/uploads/textureatlas.jpg"><img class="size-full wp-image-743" title="An example texture atlas" src="http://www.gamerendering.com/wp-content/uploads/textureatlas.jpg" alt="An example texture atlas" width="280" height="280" /></a></dt>
</dl>
</div>
<div class="mceTemp"><em>Image from article </em><a href="http://www.gamasutra.com/features/20060126/ivanov_01.shtml"><em>[2]</em></a></div>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">There are some limitations with using texture atlases compared to normal textures. First of all, all texture coordinates must initially be within 0..1 range. So for example, no “free” tiling can be used. The other problem is bleeding between tiles in the atlas when doing filtering, for example when using mipmaps.</p>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">Some additional information from Ivan-Assen Ivanov, author of article [2].</p>
<blockquote>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal"><em>&#8221; &#8211; separate textures hurts not only batching (in facts, it hurts batching less than years ago), but also memory – as there is a certain per-texture overhead. This is especially painful on consoles – on PCs, the overhead is still there, I guess, but the driver hides it from you. The exact numbers are under NDA, of course, but on an old, unreleased project, we saved about 9 MB by atlas-sing a category of textures we didn’t atlas before.</em></p>
<p><em>- vertex interpolators are expensive! make sure you measure the remapping from 0..1 to the actual UVs in the atlas both in the vertex and in the pixel shader. Sounds counterintuitive, but on modern GPUs and with dense geometry, pixel shader is actually faster.&#8221;</em> </p></blockquote>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">[1] “Improve Batching Using Texture Atlases” <a href="http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf">http://http.download.nvidia.com/developer/NVTextureSuite/Atlas_Tools/Texture_Atlas_Whitepaper.pdf</a></p>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">[2] &#8220;Practical Texture Atlases&#8221; (borrowed image from this page)<br />
<a href="http://www.gamasutra.com/features/20060126/ivanov_01.shtml">http://www.gamasutra.com/features/20060126/ivanov_01.shtml</a></p>
<p style="MARGIN-BOTTOM: 0cm; FONT-WEIGHT: normal">[3] &#8220;Batch, Batch, Batch: What Does It Really Mean?&#8221;<br />
<a href="http://developer.nvidia.com/docs/io/8230/batchbatchbatch.pdf">http://developer.nvidia.com/docs/io/8230/batchbatchbatch.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2009/12/08/texture-atlas/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>VPOS</title>
		<link>http://www.gamerendering.com/2009/12/07/vpos/</link>
		<comments>http://www.gamerendering.com/2009/12/07/vpos/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 15:35:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Shaders]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Pixel Shader]]></category>
		<category><![CDATA[Render-to-Texture]]></category>
		<category><![CDATA[Rendering]]></category>
		<category><![CDATA[SM3]]></category>
		<category><![CDATA[VPOS]]></category>

		<guid isPermaLink="false">http://www.gamerendering.com/?p=735</guid>
		<description><![CDATA[Starting with DirectX Pixel Shader Model 3.0 there exist an input type called VPOS. It&#8217;s the current pixels position on the screen and it&#8217;s automatically generated. This can be useful when sampling from a previously rendered texture when rendering an arbitrarily shaped mesh to the screen. To do this, we need uv-coords that represents where [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with DirectX Pixel Shader Model 3.0 there exist an input type called VPOS. It&#8217;s the current pixels position on the screen and it&#8217;s automatically generated. This can be useful when sampling from a previously rendered texture when rendering an arbitrarily shaped mesh to the screen. To do this, we need uv-coords that represents where to sample on the texture. These coordinates can be gained by simply dividing VPOS with the screen dimensions.<br />
When working with older hardware, that doesn&#8217;t support shader model 3.0, there is a need to manually create the VPOS in the vertex shader and pass it to the fragment shader as a TEXCOORD. This is the way to do so ( including the scaling to uv-range which manually has to be done for VPOS if you&#8217;re using it).</p>
<p><strong>Vertex Shader:</strong></p>

<div class="wp_codebox"><table width="100%" ><tr id="p7355"><td class="code" id="p735code5"><pre class="c" style="font-family:monospace;">float4x4 matWorldViewProjection<span style="color: #339933;">;</span>
float2 fInverseViewportDimensions<span style="color: #339933;">;</span>
<span style="color: #993333;">struct</span> VS_INPUT
<span style="color: #009900;">&#123;</span>
   float4 Position <span style="color: #339933;">:</span> POSITION0<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">struct</span> VS_OUTPUT
<span style="color: #009900;">&#123;</span>
   float4 Position <span style="color: #339933;">:</span> POSITION0<span style="color: #339933;">;</span>
   float4 calculatedVPos <span style="color: #339933;">:</span> TEXCOORD0<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
float4 ConvertToVPos<span style="color: #009900;">&#40;</span> float4 p <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">return</span> float4<span style="color: #009900;">&#40;</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span> float2<span style="color: #009900;">&#40;</span>p.<span style="color: #202020;">x</span> <span style="color: #339933;">+</span> p.<span style="color: #202020;">w</span><span style="color: #339933;">,</span> p.<span style="color: #202020;">w</span> <span style="color: #339933;">-</span> p.<span style="color: #202020;">y</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> p.<span style="color: #202020;">w</span><span style="color: #339933;">*</span>fInverseViewportDimensions.<span style="color: #202020;">xy</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> p.<span style="color: #202020;">zw</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
VS_OUTPUT vs_main<span style="color: #009900;">&#40;</span> VS_INPUT Input <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
   VS_OUTPUT Output<span style="color: #339933;">;</span>
   Output.<span style="color: #202020;">Position</span> <span style="color: #339933;">=</span> mul<span style="color: #009900;">&#40;</span> Input.<span style="color: #202020;">Position</span><span style="color: #339933;">,</span> matWorldViewProjection <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   Output.<span style="color: #202020;">calculatedVPos</span> <span style="color: #339933;">=</span> ConvertToVPos<span style="color: #009900;">&#40;</span>Output.<span style="color: #202020;">Position</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> Output <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Pixel Shader:<br />
</strong></p>

<div class="wp_codebox"><table width="100%" ><tr id="p7356"><td class="code" id="p735code6"><pre class="c" style="font-family:monospace;">float4 ps_main<span style="color: #009900;">&#40;</span>VS_OUTPUT Input<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> COLOR0
<span style="color: #009900;">&#123;</span>
   Input.<span style="color: #202020;">calculatedVPos</span> <span style="color: #339933;">/=</span> Input.<span style="color: #202020;">calculatedVPos</span>.<span style="color: #202020;">w</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">return</span> float4<span style="color: #009900;">&#40;</span>Input.<span style="color: #202020;">calculatedVPos</span>.<span style="color: #202020;">xy</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// test render it to the screen</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The image below shows an elephant model rendered with the shader above. As can be seen, the color (red and green channels) correctly represents the uv-coords for a fullscreen quad. Since 0,0,0 = black, 1,0,0 = red, 0,1,0 = green, 1, 1,0 = yellow.</p>
<div class="mceTemp"><a href="http://www.gamerendering.com/wp-content/uploads/vPosElephant.JPG"><img class="size-full wp-image-736" title="VPOS Elephant" src="http://www.gamerendering.com/wp-content/uploads/vPosElephant.JPG" alt="VPOS Elephant" width="177" height="162" /></a></div>
<div class="mceTemp">This is how the pixel shader would have looked like if VPOS were used instead (note: no special vertex shader needed in this case).</div>

<div class="wp_codebox"><table width="100%" ><tr id="p7357"><td class="code" id="p735code7"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">struct</span> PS_INPUT
<span style="color: #009900;">&#123;</span>
   float2 vPos <span style="color: #339933;">:</span> VPOS<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_codebox"><table width="100%" ><tr id="p7358"><td class="code" id="p735code8"><pre class="c" style="font-family:monospace;">float4 ps_main<span style="color: #009900;">&#40;</span>PS_INPUT Input<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> COLOR0
<span style="color: #009900;">&#123;</span>
   <span style="color: #b1b100;">return</span> float4<span style="color: #009900;">&#40;</span>Input.<span style="color: #202020;">vPos</span><span style="color: #339933;">*</span>fInverseViewportDimensions <span style="color: #339933;">+</span> fInverseViewportDimensions<span style="color: #339933;">*</span><span style="color:#800080;">0.5</span><span style="color: #339933;">,</span><span style="color: #0000dd;">0</span><span style="color: #339933;">,</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// test render it to the screen</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The original code, more info and proof can be found here:<br />
<a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=506573">http://www.gamedev.net/community/forums/topic.asp?topic_id=506573</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamerendering.com/2009/12/07/vpos/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

