<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>The VB.NET XNA Project</title><link>http://ilovevb.net/Web/blogs/vbxna/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/TheVbnetXnaProject" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><item><title>Iowa Code Camp - XNA Session</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2008/05/03/iowa-code-camp-xna-session.aspx</link><pubDate>Sat, 03 May 2008 20:21:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:137</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=137</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2008/05/03/iowa-code-camp-xna-session.aspx#comments</comments><description>&lt;p&gt;This weekend, I&amp;#39;m speaking at the Iowa Code Camp on &amp;quot;What&amp;#39;s This XNA Thing I Keep Hearing About?&amp;quot;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m&amp;nbsp;covering some basic XNA 2.0 concepts and a couple demos.&amp;nbsp; I&amp;#39;m doing the &lt;em&gt;Spinning Bouncing Ball&lt;/em&gt; demo in C# and the &lt;em&gt;Chase Camera&lt;/em&gt; demo in VB.NET.&lt;/p&gt;
&lt;p&gt;I was going to show off the Race Car game demo, but my laptop gets about 3 frames per second in that game.&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=137" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/code+camp/default.aspx">code camp</category></item><item><title>Bresenham's Line Algorithm - VB XNA style</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2008/04/15/bresenham-s-line-algorithm-vb-xna-style.aspx</link><pubDate>Tue, 15 Apr 2008 23:22:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:131</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=131</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2008/04/15/bresenham-s-line-algorithm-vb-xna-style.aspx#comments</comments><description>&lt;div class="csharpcode"&gt;&lt;pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;span class="lnum"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="lnum"&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;Imports&lt;/span&gt; Microsoft.Xna.Framework&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;Imports&lt;/span&gt; System.Math&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; Utils&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; This function uses Bresenham&amp;#39;s Line Algorithm to find the &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; most direct path between two points on a 2D grid and stores &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; all the points in a list.&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;param name=&amp;quot;StartPosition&amp;quot;&amp;gt;Starting X,Y coordinates&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;param name=&amp;quot;EndPosition&amp;quot;&amp;gt;Starting X,Y coordinates&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;returns&amp;gt;List(Of Vector2)&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span class="rem"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; DeterminePath(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; StartPosition &lt;span class="kwrd"&gt;As&lt;/span&gt; Vector2, _&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;nbsp;                  &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; EndPosition &lt;span class="kwrd"&gt;As&lt;/span&gt; Vector2) &lt;span class="kwrd"&gt;As&lt;/span&gt; List(Of Vector2)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; myPoint &lt;span class="kwrd"&gt;As&lt;/span&gt; Vector2 = StartPosition &lt;span class="rem"&gt;&amp;#39; current point&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; myPath &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;New&lt;/span&gt; List(Of Vector2) &lt;span class="rem"&gt;&amp;#39; collection of path points&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; Get the difference between 2 points&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; deltaX &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = EndPosition.X - StartPosition.X&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; deltaY &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = EndPosition.Y - StartPosition.Y&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; leftover &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; Figure out direction based on the +/- value of the deltas&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; dirX &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = IIf(deltaX &amp;lt; 0, -1, 1)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Dim&lt;/span&gt; dirY &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = IIf(deltaY &amp;lt; 0, -1, 1)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; Get absolute, we&amp;#39;ll decide whether to add/subtract later &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        deltaX = Abs(deltaX)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        deltaY = Abs(deltaY)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; Uncomment this to add the first point to the path (list)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; myPath.Add(myPoint)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;        &lt;span class="rem"&gt;&amp;#39; iterate through whichever axis is longest&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;        &lt;span class="kwrd"&gt;If&lt;/span&gt; deltaX &amp;gt; deltaY &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;            leftover = (deltaY * 2) - deltaX&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;            &lt;span class="kwrd"&gt;While&lt;/span&gt; myPoint.X &amp;lt;&amp;gt; EndPosition.X&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;                &lt;span class="kwrd"&gt;If&lt;/span&gt; leftover &amp;gt;= 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;                    myPoint.Y = myPoint.Y + dirY&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;                    leftover = leftover - deltaX&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;                myPoint.X = myPoint.X + dirX&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;                leftover = leftover + deltaY&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;                myPath.Add(myPoint)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;While&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Else&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;            leftover = (deltaX * 2) - deltaY&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;            &lt;span class="kwrd"&gt;While&lt;/span&gt; myPoint.Y &amp;lt;&amp;gt; EndPosition.Y&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;                &lt;span class="kwrd"&gt;If&lt;/span&gt; leftover &amp;gt;= 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;                    myPoint.X = myPoint.X + dirX&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;                    leftover = leftover - deltaY&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;                &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;                myPoint.Y = myPoint.Y + dirY&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;                leftover = leftover + deltaX&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt;                myPath.Add(myPoint)&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;            &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;While&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt;        &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;        &lt;span class="kwrd"&gt;Return&lt;/span&gt; myPath&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;    &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;span class="lnum"&gt;While I was working on my EnemyAI demo for code camp, I needed a way to plot the most efficient line between two points. Bresenham&amp;#39;s Line Drawing Algorithm is pretty much the industry standard for lines, but I couldn&amp;#39;t find a VB implementation I liked, so I wrote my own. &lt;/span&gt;&lt;span class="lnum"&gt;I went ahead and used the Vector2 data type from XNA, but if you aren&amp;#39;t doing XNA you could easily create a custom data type that contains a pair of integer values.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The way you use this is pretty simple.&amp;nbsp; Given two sets of coordinates (begin and end position), this will return a collection of Vector2s.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;How it works&lt;/h2&gt;
&lt;p&gt;This algorithm compares the delta between the starting and ending X coordinate, and the starting and ending Y coordinate. In order to have the straightest possible line (that isn&amp;#39;t purely horizontal or purely vertical) we have a rule that you can&amp;#39;t have adjacent pixels on the shortest axis. This provides a much smoother transition along the longer axis.&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=131" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/bresenham/default.aspx">bresenham</category></item><item><title>Enemy AI</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2008/01/14/enemyai.aspx</link><pubDate>Tue, 15 Jan 2008 03:02:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:67</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=67</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2008/01/14/enemyai.aspx#comments</comments><description>&lt;p&gt;After December&amp;#39;s marathon, I&amp;#39;m taking a short break from converting the Creators Club samples to&amp;nbsp;VB&amp;nbsp;so I can work on something else of interest.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m working on an AI techniques presentation for my XNA user group. I&amp;#39;m doing it all in VB (because I can) and hopefully will turn it into an article once it&amp;#39;s all done. I&amp;#39;m using a few XNA datatypes (like Vector2 and Texture2D) so technically its XNA related.&lt;/p&gt;
&lt;p&gt;So the VB Samples will return in a few weeks, and of course, I&amp;#39;ll post the AI stuff up here as well when it&amp;#39;s done.&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=67" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/samples/default.aspx">samples</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/AI/default.aspx">AI</category></item><item><title>Heightmap Collision Sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/28/heightmap-collision-sample-posted.aspx</link><pubDate>Fri, 28 Dec 2007 07:13:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:62</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=62</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/28/heightmap-collision-sample-posted.aspx#comments</comments><description>&lt;p&gt;This one was a real pain, but it&amp;#39;s the second sample I&amp;#39;ve done with a custom ContentProcessor. Grab the vb.net code &lt;a href="http://ilovevb.net/Web/files/folders/samples/entry61.aspx"&gt;&lt;span class=""&gt;here&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;div id="mainSection"&gt;
&lt;div id="mainBody"&gt;
&lt;h1&gt;Heightmap Collision&lt;/h1&gt;This sample demonstrates how to move objects along a heightmap. It is based on the Generated Geometry sample, which creates a landscape from a bitmap. We build upon that sample, showing how to quickly calculate the height of any point on that heightmap. &lt;a title="ID2EK" class="" name="ID2EK"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EK"&gt;
&lt;p&gt;The Generated Geometry sample introduced the concept of a heightmap. In that sample, a content processor reads a bitmap and uses the intensity of its pixels as height values on a terrain. A logical next step to this technique is to place objects on the terrain. This sample demonstrates that technique by placing a ball on the generated terrain. &lt;/p&gt;&lt;a title="ID2EQ" class="" name="ID2EQ"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Minimum Shader Profile&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2EQ"&gt;

Vertex Shader Model 1.1
Pixel Shader Model 1.1&lt;/div&gt;&lt;a title="ID2E3" class="" name="ID2E3"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Sample Controls&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2E3"&gt;
&lt;p&gt;This sample uses the following keyboard and gamepad controls.&lt;/p&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Keyboard Control&lt;/th&gt;
&lt;th&gt;Gamepad Control&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Move the ball.&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;b&gt;UP ARROW&lt;/b&gt;, &lt;b&gt;DOWN ARROW&lt;/b&gt;, &lt;b&gt;LEFT ARROW&lt;/b&gt;, and &lt;b&gt;RIGHT ARROW&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;or &lt;b&gt;W&lt;/b&gt;, &lt;b&gt;A&lt;/b&gt;, &lt;b&gt;S&lt;/b&gt;, and &lt;b&gt;D&lt;/b&gt; &lt;/p&gt;&lt;/td&gt;
&lt;td&gt;Left thumb stick or D-Pad&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exit the sample.&lt;/td&gt;
&lt;td&gt;ESC or ALT+F4&lt;/td&gt;
&lt;td&gt;&lt;b&gt;BACK&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;a title="ID2E2C" class="" name="ID2E2C"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;How the Sample Works&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2E2C"&gt;
&lt;p&gt;This sample is based on the Generated Geometry sample. To support the added functionality, the original sample has been modified in several ways. For clarity, the sky has also been removed. &lt;/p&gt;&lt;a title="ID2EBD" class="" name="ID2EBD"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Changes to the Terrain Processor&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2EBD"&gt;
&lt;p&gt;The &lt;code&gt;TerrainProcessor&lt;/code&gt; has been modified slightly for this new sample. First, the algorithm that gives the vertices their XZ position has been modified slightly from the generated geometry sample. In the new version, the positions are calculated so that the heightmap is always centered around the origin. This change simplifies the math at run time. &lt;/p&gt;
&lt;p&gt;In addition, the processor is responsible for creating a class called &lt;code&gt;HeightMapInfoContent&lt;/code&gt;, which contains data about the height of the points of the heightmap, as well as the distance between them. This information is attached to the finished terrain model&amp;#39;s &lt;code&gt;.Tag&lt;/code&gt; property, and will be read when the game loads. &lt;/p&gt;
&lt;p&gt;Finally, the &lt;code&gt;SkyProcessor&lt;/code&gt; and &lt;code&gt;SkyContent&lt;/code&gt; classes have been removed from the pipeline assembly. &lt;/p&gt;&lt;/div&gt;&lt;a title="ID2EZD" class="" name="ID2EZD"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Rolling Around on the Terrain&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2EZD"&gt;
&lt;p&gt;The user is now given direct control over a small sphere, which can roll over the terrain. The camera, which used to move in a fixed circular pattern around the terrain, is now tied to follow the sphere. To make it more obvious which code is new, we removed the &lt;code&gt;Sky&lt;/code&gt; class from the sample. &lt;/p&gt;
&lt;p&gt;To keep both the sphere and the camera on top of the terrain, we use the &lt;code&gt;GetHeight&lt;/code&gt; function on &lt;code&gt;HeightMapInfo&lt;/code&gt;. &lt;code&gt;GetHeight&lt;/code&gt; is the most complicated part of this sample. This function accepts a position as an argument and returns the height of the heightmap at that position. &lt;/p&gt;&lt;img src="http://ilovevb.net/images/content/zoomedout.png" alt="" border="0" height="420" width="465" /&gt; 
&lt;p&gt;In this diagram, we are trying to calculate the height of the red circle. The grid represents our heightmap. In this example, our heightmap is 4×4. Note that this means that the heightmap&amp;#39;s width and height are only 3 * &lt;code&gt;TerrainScale&lt;/code&gt;. We&amp;#39;ll call the white space between gridlines &amp;quot;cells.&amp;quot; &lt;/p&gt;
&lt;p&gt;To calculate the red circle&amp;#39;s height at any point on a cell, we use bilinear interpolation. This is a lot simpler than it sounds. To understand how it works, let&amp;#39;s first examine the simpler case, linear interpolation. &lt;/p&gt;&lt;img src="http://ilovevb.net/images/content/lerp.png" alt="" border="0" height="313" width="582" /&gt; 
&lt;p&gt;In this diagram, we know the (x,y) coordinates of two points on the red line: (2,1) and (8,4). We want to find out the y-coordinate at x = 4. (The diagram isn&amp;#39;t to scale at all, so don&amp;#39;t get out your rulers; you&amp;#39;ll be disappointed.) To find the missing value, we can use linear interpolation. There are several different ways to do this. We&amp;#39;ll use a method that, when ported to C# code, lets us make use of &lt;code&gt;MathHelper.Lerp&lt;/code&gt; (linear interpolate) and will be fairly efficient. &lt;/p&gt;
&lt;p&gt;The process is relatively straightforward. We know the x-coordinates of all three points, and we can see that the x-coordinate of the center point, which we are trying to find, is 1/3 of the way between the x-coordinate of the other two points. (In other words, the distance from x = 2 to x = 4 is 1/3 of the distance from x = 2 to x = 8.) Since the points are all on a straight line, the y-coordinate must also be 1/3 of the way. &lt;/p&gt;
&lt;p&gt;The distance between the two y-coordinates, y = 1 and y = 4, is 3. So, if the y-coordinate at (4,?) is 1/3 of that distance away from the point on the left, our missing value is: &lt;/p&gt;
&lt;p&gt;1 + (1/3) × 3 = 2&lt;/p&gt;
&lt;p&gt;Simple enough. Bilinear interpolation will extend that principle further.&lt;/p&gt;&lt;img src="http://ilovevb.net/images/content/closeup.png" alt="" border="0" height="426" width="568" /&gt; 
&lt;p&gt;In this diagram, we are again on a heightmap, trying to calculate the height of our red circle. We know all of the heights at the corners of the cell, since we read those in from the bitmap, remember? We also know the x- and z-coordinates of the red circle. What we don&amp;#39;t know is the height, y. &lt;/p&gt;
&lt;p&gt;So first, we do a linear interpolation on the top edge of the cell. We go from the (left,top) corner to the (left+1,top) corner, and find the height at point A. Then, we do the same thing on the bottom edge of the cell, calculating the height at point B. Now we know the heights at A and B, both of which are on a straight line with the circle! To find the height of the circle, we do one more linear interpolation between A and B, and we&amp;#39;ve got our height. &lt;/p&gt;
&lt;p&gt;Note that this technique is not perfect: on steep hills, it is still possible that parts of the sphere may clip through the terrain. To avoid this, we would have to perform a much more expensive collision check. Our technique, although imperfect, is inexpensive, and yields results that will suffice for many games. &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;a title="ID2EVF" class="" name="ID2EVF"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Extending the Sample&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EVF"&gt;
&lt;ul&gt;
&lt;li&gt;The camera in this sample is fairly simple. Try taking the camera from the Chase Camera sample, and putting it into this one.&lt;/li&gt;
&lt;li&gt;When moving objects over a heightmap, you may also want to align them to the slope of the terrain. To do this, you&amp;#39;ll need to calculate the heightmap&amp;#39;s normal vectors in the &lt;code&gt;TerrainProcessor&lt;/code&gt;. A &lt;code&gt;GetNormal&lt;/code&gt; function would work similarly to &lt;code&gt;GetHeight&lt;/code&gt;, except all three components of the vector would have to be interpolated separately and then renormalized. Using this normal vector, you can calculate an orientation matrix for your object. &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=62" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/contentprocessor/default.aspx">contentprocessor</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/heightmap/default.aspx">heightmap</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/custom/default.aspx">custom</category></item><item><title>nothing like vacation time to really get some work done.</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/27/nothing-like-vacation-time-to-really-get-some-work-done.aspx</link><pubDate>Thu, 27 Dec 2007 07:57:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:60</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=60</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/27/nothing-like-vacation-time-to-really-get-some-work-done.aspx#comments</comments><description>&lt;p&gt;The last few days have been incredibly productive for me, in terms of cranking out conversions.&lt;/p&gt;
&lt;p&gt;Not only did I post several new conversions, but I also managed to wrap up two that had been giving me trouble since day one.&amp;nbsp; The Bloom PostProcess sample and the Billboard sample have both been a real pain to convert, and I had pretty much given up on both of them until just recently. &lt;/p&gt;
&lt;p&gt;I&amp;#39;ve learned a lot from converting some of the recent samples (I&amp;#39;ve learned something from all of them really) and something in my brain clicked just enough to make me want to revisit those two samples mentioned above and wouldn&amp;#39;t you know it... I was able to find the problems and get them working.&lt;/p&gt;
&lt;p&gt;I hope to knock out the rest of the samples pretty soon so I can get started on converting the starter kits and the rest of the tutorials.&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=60" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category></item><item><title>Billboard Sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/27/billboard-sample-posted.aspx</link><pubDate>Thu, 27 Dec 2007 07:54:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:59</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=59</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/27/billboard-sample-posted.aspx#comments</comments><description>&lt;p&gt;This is the vb.net version of the Billboard sample as seen on Creators.XNA.com.&amp;nbsp; Grab the source code &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry58.aspx"&gt;here&lt;/a&gt;. This was another one of the more difficult samples to get working. I spent a few weeks on this one, scratching my head trying to figure out why it didnt work. I was initially&amp;nbsp;worried that custom content processors couldnt be done in vb.net, but this sample proves that theory wrong.&lt;br /&gt;&lt;/p&gt;
&lt;div id="mainSection"&gt;
&lt;div id="mainBody"&gt;
&lt;h1&gt;Billboard Sample&lt;/h1&gt;This sample shows how to efficiently render large numbers of billboard sprites, using a vertex shader to perform the billboard computations entirely on the GPU. &lt;a class="" title="ID2EJ" name="ID2EJ"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EJ"&gt;
&lt;p&gt;A billboard is a way of faking complex objects without bothering to render a full 3D model. The idea is that where the 3D object would have been, you simply render a 2D sprite with a picture of the object textured onto it. If the player moves around to look at the object from a different direction, you rotate the sprite so that it will always face toward the camera, thus preventing them from ever seeing it &amp;quot;edge on&amp;quot; and being able to tell that it is just a 2D image.&lt;/p&gt;
&lt;p&gt;This technique is obviously not as convincing as rendering a true 3D model would be, but it can be much faster, especially for large numbers of objects such as the field of grass shown in this sample. By moving the camera around, you can get an idea of what situations the billboards look good in, and also where the illusion starts to break down.&lt;/p&gt;
&lt;p&gt;Because this billboard implementation runs entirely in the vertex shader, there is no additional CPU load from rendering billboards compared to normal static geometry. This makes it feasible to render very large numbers of billboards at a good framerate.&lt;/p&gt;&lt;a class="" title="ID2ET" name="ID2ET"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Minimum Shader Profile&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2ET"&gt;

Vertex Shader Model 1.1 
Pixel Shader Model 1.1 &lt;/div&gt;&lt;a class="" title="ID2E6" name="ID2E6"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Sample Controls&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2E6"&gt;
&lt;div class="proc"&gt;
&lt;h3 class="subHeading"&gt;Keyboard:&lt;/h3&gt;
&lt;div class="subSection"&gt;
&lt;ul&gt;
&lt;li&gt;UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW = rotate camera 
&lt;li&gt;&lt;b&gt;W&lt;/b&gt; = forward, &lt;b&gt;S&lt;/b&gt; = backward 
&lt;li&gt;&lt;b&gt;A&lt;/b&gt; and &lt;b&gt;D&lt;/b&gt; = strafe 
&lt;li&gt;&lt;b&gt;R&lt;/b&gt; = reset 
&lt;li&gt;ESC or ALT+F4 = exit &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div class="proc"&gt;
&lt;h3 class="subHeading"&gt;Gamepad:&lt;/h3&gt;
&lt;div class="subSection"&gt;
&lt;ul&gt;
&lt;li&gt;Right thumb stick = rotate camera 
&lt;li&gt;Left thumb stick = move camera 
&lt;li&gt;Right thumb stick press = reset camera 
&lt;li&gt;&lt;b&gt;BACK&lt;/b&gt; = exit &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a class="" title="ID2ETC" name="ID2ETC"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;How the Sample Works&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2ETC"&gt;
&lt;p&gt;The &lt;b&gt;VegetationProcessor&lt;/b&gt; takes in a simple landscape mesh and randomly creates billboard polygons scattered across it. These new polygons are set to render using the Billboard.fx effect, and a number of different billboard textures and sizes are randomly selected.&lt;/p&gt;
&lt;p&gt;In the vertex shader, the billboard effect calculates vertex positions by examining the view matrix to make sure the billboard sprite will always face toward the camera. It also uses a per-billboard random number to make each billboard a slightly different shape, and to randomly mirror the textures on half of the billboards, adding variety to the results. Finally, it uses a sine wave pattern to make the top two vertices of each billboard sway back and forth, simulating the effect of wind on the vegetation. The amount of this swaying is controlled by an effect parameter, so some types of billboard can be set to sway more than others, or to remain entirely still.&lt;/p&gt;
&lt;p&gt;Billboard lighting is calculated using the normal of the underlying landscape geometry. This means that vegetation will be lighter or darker depending on the angle of the hill that it is growing on, and will always be lit consistently with the underlying surface. In a more sophisticated landscape engine, it would be possible to make each billboard sample into the landscape texture to automatically pick up an appropriate color from the ground below it.&lt;/p&gt;
&lt;p&gt;The billboards are rendered in two passes, using different alpha test and depth buffer settings to achieve almost correct depth sorting of alpha blended sprites without requiring them to be depth sorted on the CPU first. The comments at the end of the Billboard.fx file explain this technique in detail.&lt;/p&gt;
&lt;p&gt;Note that although the billboard effect is included as part of the Game Studio project file, its &lt;b&gt;XNA Framework Content&lt;/b&gt; property has been set to &lt;b&gt;false&lt;/b&gt;. This effect will be built automatically because it is referenced by the &lt;b&gt;VegetationProcessor&lt;/b&gt;, so there is no need for it to be duplicated in the project. It was only included here so you can easily locate the file for viewing or editing the effect code.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=59" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/billboard/default.aspx">billboard</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/2d/default.aspx">2d</category></item><item><title>Bloom PostProcess Sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/24/bloom-postprocess-sample-posted.aspx</link><pubDate>Tue, 25 Dec 2007 02:45:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:57</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=57</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/24/bloom-postprocess-sample-posted.aspx#comments</comments><description>&lt;p&gt;This one took me a while to convert. There were a few hard to track down issues, but I eventually got it working.&amp;nbsp;Grab the code &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry56.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div id="mainSection"&gt;
&lt;div id="mainBody"&gt;
&lt;h1&gt;BloomPostprocess Sample&lt;/h1&gt;This sample shows how to use bloom post-processing filters to add a glow effect over the top of an existing scene. &lt;a class="" title="ID2EK" name="ID2EK"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EK"&gt;
&lt;p&gt;Bloom post-processing emulates the visual effect of bright lights and glowing objects. It does this by extracting the brightest parts of an image to a custom render target, blurring these bright areas, and then adding the blurred result back into the original image.&lt;/p&gt;
&lt;p&gt;Because bloom is implemented entirely as a post-process, it can easily be used over the top of any other 2D or 3D rendering techniques. In addition to the more extreme glowing effects, when used subtly it provides a useful softening that can make computer graphics look more organic and help to hide artifacts from elsewhere in your rendering. Particle systems, for example, often look better with a subtle bloom applied over the top.&lt;/p&gt;&lt;a class="" title="ID2ES" name="ID2ES"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Minimum Shader Profile&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2ES"&gt;

Vertex Shader Model 1.1 
Pixel Shader Model 2.0 &lt;/div&gt;&lt;a class="" title="ID2E5" name="ID2E5"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Sample Controls&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2E5"&gt;
&lt;p&gt;This sample uses the following keyboard and gamepad controls.&lt;/p&gt;
&lt;table class=""&gt;

&lt;tr&gt;
&lt;th class=""&gt;Action&lt;/th&gt;
&lt;th class=""&gt;Keyboard Control&lt;/th&gt;
&lt;th class=""&gt;Gamepad Control&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Change the bloom settings.&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;A&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;A&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Toggle bloom on or off.&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;B&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;B&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Show intermediate render target contents.&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;X&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;X&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Exit.&lt;/td&gt;
&lt;td class=""&gt;ESC or ALT+F4&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;BACK&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;a class="" title="ID2ELD" name="ID2ELD"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;How the Sample Works&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2ELD"&gt;
&lt;p&gt;There are three stages to applying a bloom post-process.&lt;/p&gt;

&lt;b&gt;Pass 1&lt;/b&gt; 
Extract the brightest parts of the scene. This uses the BloomExtract.fx pixel shader, which removes any areas darker than the specified threshold parameter value. Modifying the threshold changes the look of the bloom: higher values produce smaller and better defined glows, while smaller ones produce a softer end result. To see just the result of this first pass, press &lt;b&gt;X&lt;/b&gt; until the overlay display shows &amp;quot;PreBloom&amp;quot;. 
&lt;b&gt;Passes 2 and 3&lt;/b&gt; 
Blur the bright areas. This is done using the GaussianBlur.fx pixel shader—first, to blur the image horizontally, and then again to blur it vertically. The shader does multiple lookups into different parts of the source texture, and then averages the results using a Gaussian curve to weight the importance of each sample. The work is split over two passes because Shader Model 2.0 is not capable of doing enough texture lookups to give a high-quality blur along both the horizontal and vertical axis in a single pass. To see the result of these blur passes, press &lt;b&gt;X&lt;/b&gt; until the overlay display shows &amp;quot;BlurredHorizontally&amp;quot; or &amp;quot;BlurredBothWays.&amp;quot; 
&lt;b&gt;Pass 4&lt;/b&gt; 
Combine the blurred result with the original image. This uses the BloomCombine.fx pixel shader, which has parameters to control how much bloom to include, how much of the original image to retain, and for adjusting the color saturation of both the bloom and original base images. Tweaking these settings can produce a wide range of visual effects. &lt;/div&gt;&lt;a class="" title="ID2ESE" name="ID2ESE"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Extending the Sample&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2ESE"&gt;
&lt;p&gt;Rather than just choosing a fixed set of bloom settings, you could adjust these on the fly depending on what is happening in your game. Perhaps you could make the world go greyer and more blurry when the player has low health, or increase the amount of glow for a second or two when the player gets a power-up.&lt;/p&gt;
&lt;p&gt;You can also adjust bloom settings to mimic how the human eye responds to changing light levels. If the player is in a long tunnel, turn the bloom up very high so any areas of the outside world that are visible past the end of the tunnel will burn-out to white and have a huge glow around them. After they leave the tunnel, gradually fade the bloom down to a level where they will be able to see normally again.&lt;/p&gt;
&lt;p&gt;For a higher-quality bloom, you can render your world using high-dynamic-range (HDR) lighting information, using a floating-point back buffer format to store pixels even brighter than 1.0.&lt;/p&gt;
&lt;p&gt;The Gaussian blur used in this sample could be replaced with any other kind of filter. For example, you could use a blur pass with large sample offsets to create various kinds of lens-flare effects.&lt;/p&gt;
&lt;p&gt;The blur-and-combine pass is a great place to include other kinds of image manipulation. In addition to using the saturation adjustment used in this sample, you could do tone mapping here, or tint the image, or blend in a layer of noise or film grain. This infrastructure is a good starting place for other kinds of post-processing, too, opening up the non-photorealistic world of edge detection, embossing, pencil sketch rendering, and other such techniques.&lt;/p&gt;&lt;/div&gt;&lt;a class="" title="ID2EBF" name="ID2EBF"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Converting to XNA Game Studio 2.0 &lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EBF"&gt;
&lt;p&gt;The most substantial changes are in the BloomComponent. Here, we must update the sample to use XNA Game Studio 2.0 revised render target APIs. First up, we need to change the type of the field &lt;b&gt;resolveTarget&lt;/b&gt;. In version 1.0 when resolving a render target or back buffer, the destination of the resolve had to be a Texture created with the special flag &lt;b&gt;ResourceUsage.ResolveTarget&lt;/b&gt;. Many found this pattern confusing, and in XNA Game Studio 2.0 this flag has been removed. Instead, we simply create an instance of the type &lt;b&gt;ResolveTexture2D&lt;/b&gt; with no flags at all. &lt;/p&gt;
&lt;p&gt;The next change comes in &lt;b&gt;BloomComponent.Draw&lt;/b&gt;. In this function, we used to temporarily disable the depth stencil buffer to avoid writing to it, and then would set it back when finished. This is actually not necessary. The draw function uses SpriteBatch, which draws with the depth buffer disabled. So, we do not need to do anything to &amp;quot;protect&amp;quot; the buffer: it could not have been modified anyway! In the new version of the sample, we avoid changing the depth stencil buffer because doing so leaves the current render target in an undefined state. &lt;/p&gt;
&lt;p&gt;Finally, we must update &lt;b&gt;DrawFullscreenQuad&lt;/b&gt;. In the first version of this sample, the function &lt;b&gt;ResolveRenderTarget&lt;/b&gt; was used to explicitly resolve the current renderTarget. This method is now considered obsolete and causes a compilation error if used in your code. The actual resolve operation occurs automatically when a new render target is set (for example, a call to &lt;b&gt;SetRenderTarget&lt;/b&gt;). So, we replace the call to &lt;b&gt;ResolveRenderTarget(0)&lt;/b&gt; with &lt;b&gt;SetRenderTarget(0,nothing)&lt;/b&gt;. This resolves &lt;b&gt;renderTarget&lt;/b&gt; and sets the current render target back to the back buffer. &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=57" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/postprocess/default.aspx">postprocess</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/bloom/default.aspx">bloom</category></item><item><title>Color Replacement Sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/24/color-replacement-sample-posted.aspx</link><pubDate>Tue, 25 Dec 2007 00:56:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:55</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=55</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/24/color-replacement-sample-posted.aspx#comments</comments><description>&lt;p&gt;Grab the vb.net code sample &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry54.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div id="mainBody"&gt;
&lt;h1&gt;Color Replacement Sample&lt;/h1&gt;This sample demonstrates how to render parts of an object with a user-defined color. &lt;a class="" title="ID2EK" name="ID2EK"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EK"&gt;
&lt;p&gt;When it is the Red Team versus the Blue Team or when you want to drive a car painted with your favorite color, you either need to create a texture for each color or perform color replacement programmatically. This sample implements color replacement using an artist-defined alpha map that acts similar to a spray paint stencil. The stencil enables you to have soldiers with any color armor you choose without tinting their faces the same color.&lt;/p&gt;&lt;a class="" title="ID2EQ" name="ID2EQ"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Minimum Shader Profile&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2EQ"&gt;

Vertex Shader Model 1.1
Pixel Shader Model 1.1&lt;/div&gt;&lt;a class="" title="ID2E3" name="ID2E3"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;Sample Controls&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2E3"&gt;
&lt;p&gt;This sample uses the following keyboard and gamepad controls.&lt;/p&gt;
&lt;table class=""&gt;

&lt;tr&gt;
&lt;th class=""&gt;Action&lt;/th&gt;
&lt;th class=""&gt;Keyboard Control&lt;/th&gt;
&lt;th class=""&gt;Gamepad Control&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Select the red channel (hold).&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;R&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;B&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Select the green channel (hold).&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;G&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;A&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Select the blue channel (hold).&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;B&lt;/b&gt; &lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;X&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;Exit the sample.&lt;/td&gt;
&lt;td class=""&gt;ESC or Alt+F4&lt;/td&gt;
&lt;td class=""&gt;&lt;b&gt;BACK&lt;/b&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;a class="" title="ID2EGD" name="ID2EGD"&gt;&lt;/a&gt;
&lt;h2 class="subHeading"&gt;How the Sample Works&lt;/h2&gt;
&lt;div class="hxnx2" id="ID2EGD"&gt;
&lt;p&gt;The color replacement is performed by the simple high-level shader language (HLSL) effect defined in ReplaceColor.fx. The model&amp;#39;s diffuse texture contains the typical red, green, and blue channels for the base color, but also contains an alpha channel. The alpha channel defines which parts of the texture should be color replaced and by how much. The final color before lighting is calculated using a linear interpolation between the base diffuse color and the target color. An alpha value of zero indicates that the base color should be unchanged, while an alpha value of one indicates that the target color should completely replace the base color. &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=55" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/color/default.aspx">color</category></item><item><title>2D Collision Sample #3 (Transformed) posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/21/2d-collision-sample-3-transformed-posted.aspx</link><pubDate>Fri, 21 Dec 2007 15:44:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:51</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=51</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/21/2d-collision-sample-3-transformed-posted.aspx#comments</comments><description>&lt;p&gt;Sample code for part three in the Collision Series (Transformed Collisions) has been posted &lt;a class="" href="http://ilovevb.net/Web/ControlPanel/Files/FileEditor.aspx?SectionID=9&amp;amp;PostID=50"&gt;here&lt;/a&gt;. Original tutorial posted at &lt;a href="http://creators.xna.com/"&gt;http://creators.xna.com&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Collision Series 3: 2D Collision with Transformed Objects&lt;/h1&gt;
&lt;p&gt;This article explains how to perform per-pixel collision detection on sprites by using linear transformations such as rotation or scale. &lt;/p&gt;
&lt;h1 class="heading"&gt;Introduction&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EM"&gt;
&lt;p&gt;In the previous sample, you enhanced your simple obstacle avoidance game by adding per-pixel collisions, which are more accurate than the previously existing bounding rectangle test. The per-pixel technique presented in tutorial 2 accommodates only positioned sprites, without any other transformations. For many games, this is completely sufficient. However, if your game requires objects that are rotated, scaled, or otherwise linearly transformed, you are going to need a more sophisticated per-pixel collision test.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=51" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/collision/default.aspx">collision</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/transformation/default.aspx">transformation</category></item><item><title>2D Collision Sample #2 (per pixel) posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/18/2d-collision-sample-2-per-pixel-posted.aspx</link><pubDate>Wed, 19 Dec 2007 04:35:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:40</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=40</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/18/2d-collision-sample-2-per-pixel-posted.aspx#comments</comments><description>&lt;p&gt;&lt;em&gt;The VB.NET version of the per pixel collision sample. Grab it from the files section&amp;nbsp;&lt;/em&gt;&lt;a class="" href="http://ilovevb.net/Web/controlpanel/Files/FileEditor.aspx?SectionID=9&amp;amp;PostID=39"&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;&lt;em&gt;!&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;div id="mainBody"&gt;
&lt;h1&gt;&lt;br /&gt;2D Collision Sample 2: Per-Pixel&lt;/h1&gt;This sample demonstrates per-pixel collision detection. 
&lt;div class="alert"&gt;&lt;/div&gt;&lt;a class="" title="ID2EM" name="ID2EM"&gt;&lt;/a&gt;
&lt;h1 class="heading"&gt;Introduction&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EM"&gt;
&lt;p&gt;In the previous example, you created a simple object avoidance game using rectangle collision detection. The rectangles used were only an approximation of the blocks and person drawn into the textures. You may have noticed the exclusive use of rectangles resulted in imprecise behavior for nonrectangular objects.&lt;/p&gt;
&lt;p&gt;In order to achieve the desired behavior, the code must examine every overlapping pixel to determine if there is a collision. This is called per-pixel collision.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=40" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/collision/default.aspx">collision</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/per+pixel/default.aspx">per pixel</category></item><item><title>2D Collision Sample #1 (Rectangle) posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/16/2d-collision-sample-1-rectangle-posted.aspx</link><pubDate>Sun, 16 Dec 2007 19:12:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:37</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=37</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/16/2d-collision-sample-1-rectangle-posted.aspx#comments</comments><description>&lt;em&gt;The VB.NET version of the Rectangle Collision Sample.&amp;nbsp; Grab it from the files section&amp;nbsp;&lt;/em&gt;&lt;a class="" href="http://ilovevb.net/Web/files/folders/29/download.aspx"&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;&lt;em&gt;! &lt;/em&gt;
&lt;h1&gt;&lt;br /&gt;2D Collision Sample 1: Rectangle&lt;/h1&gt;
&lt;p&gt;This sample shows a simple technique for constraining motion and collision detection in 2D. &lt;a class="" title="ID2EJ" name="ID2EJ"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1 class="heading"&gt;Introduction&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EJ"&gt;
&lt;p&gt;Games do not need to be complex to be fun and interesting. Obstacle avoidance games consist of a character and some objects that are on a crash course towards each other. The player must avoid the oncoming objects.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=37" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/collision/default.aspx">collision</category></item><item><title>Chase and Evade sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/03/chase-and-evade-sample-posted.aspx</link><pubDate>Mon, 03 Dec 2007 05:25:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:31</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=31</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/12/03/chase-and-evade-sample-posted.aspx#comments</comments><description>&lt;p&gt;Another VB.NET XNA&amp;nbsp;sample. You can grab it &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry29.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; This one is archived in RAR format. See &lt;a class="" href="http://ilovevb.net/Web/blogs/sitenews/archive/2007/12/03/zip-vs-rar.aspx"&gt;here&lt;/a&gt; for explanation.&lt;/p&gt;
&lt;h1&gt;Chasing and Evading Sample&lt;/h1&gt;
&lt;p&gt;This sample shows how to implement several simple behaviors for AI, including chasing, evading, and wandering. &lt;a class="" title="ID2EK" name="ID2EK"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EK"&gt;
&lt;p&gt;This sample demonstrates chasing and evading behaviors by using three actors—a cat, a mouse, and a tank. The tank and the mouse are controlled by AI, and the cat is controlled by the player. The tank chases the cat, and the mouse runs from the cat. The tank and the mouse wander around the screen when the cat is not nearby. The &amp;quot;turn toward&amp;quot; functionality from the aiming sample makes it very simple to create these behaviors: chase, evade, and wander.&lt;/p&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=31" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/chase/default.aspx">chase</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/sample/default.aspx">sample</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/evade/default.aspx">evade</category></item><item><title>Chase Camera sample posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/30/chase-camera-sample-posted.aspx</link><pubDate>Fri, 30 Nov 2007 08:55:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:26</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=26</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/30/chase-camera-sample-posted.aspx#comments</comments><description>&lt;p&gt;This was the third sample I converted, pretty basic stuff. In addition to converting from C# to VB.NET, it&amp;#39;s also been updated for XNA 2.0.&amp;nbsp; You can grab the archive &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry25.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Chase Camera Sample&lt;/h1&gt;
&lt;p&gt;This sample demonstrates how to create a simple chase camera with spring physics. &lt;a class="" name="ID2EK"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1 class="heading"&gt;Sample Overview&lt;/h1&gt;
&lt;div class="hxnx1" id="ID2EK"&gt;
&lt;p&gt;In this sample, you can pilot a Spacewar ship from a third-person chase camera view. The motion of both the ship and the camera are governed by simple physics. When the ship speeds away, the camera pulls back. When the ship turns, the camera lags behind in the turn to show a partial profile view of the ship. When the ship stops moving, the camera gradually slides back into place. &lt;/p&gt;
&lt;p&gt;By pressing a button, you can compare and contrast the spring-based camera with a rigid, fixed-offset camera. You will notice that the spring-based camera provides a greater sense of speed and the ship will feel more natural to control. &lt;/p&gt;&lt;/div&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=26" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/samples/default.aspx">samples</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/camera/default.aspx">camera</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/chase/default.aspx">chase</category></item><item><title>XNA GS 2.0(beta) deployment platform bug (what causes it and how to workaround it)</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/28/xna-gs-2-0-beta-deployment-platform-bug-what-causes-it-and-how-to-workaround-it.aspx</link><pubDate>Wed, 28 Nov 2007 18:40:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:15</guid><dc:creator>admin</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=15</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/28/xna-gs-2-0-beta-deployment-platform-bug-what-causes-it-and-how-to-workaround-it.aspx#comments</comments><description>&lt;p&gt;First... how to cause the problem.&lt;/p&gt;
&lt;p&gt;1. Create&amp;nbsp;a new C# Windows Game 2.0 project in VS2005.&lt;/p&gt;
&lt;p&gt;If you take a look at this point, in the Configuration Manager, you will see 2 entries. One is for the Content project and the other is for whatever you named your new project. So far, so good.&lt;/p&gt;
&lt;p&gt;2. Add a new VB.NET Class Library project to your solution. (Make sure to add it to the solution, not create a new one.)&lt;/p&gt;
&lt;p&gt;Take a look in the Configuration Manager again. Now you&amp;#39;ll see 3 entries, including a new one for the VB.NET Class Library you just added. You should also notice that the Content project&amp;#39;s Platform has changed from x86 to Xbox 360. That&amp;#39;s a problem.&lt;/p&gt;
&lt;p&gt;Fortunately, fixing it is easy enough.&lt;/p&gt;
&lt;p&gt;3. Click on the Active Solution Platform dropdown box and select x86 (it probably says Mixed Platforms when you look at it.)&lt;/p&gt;
&lt;p&gt;4. Save, Recompile, etc...&amp;nbsp; you&amp;#39;re all set.&lt;/p&gt;
&lt;p&gt;FWIW, this has already been reported to Connect (you&amp;#39;re welcome) and has been marked as fixed in the final version. After all, we are using Beta stuff, so it&amp;#39;s not entirely unexpected.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=15" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/Configuration+Manager/default.aspx">Configuration Manager</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/Active+Solution+Platform/default.aspx">Active Solution Platform</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vs2005/default.aspx">vs2005</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/beta/default.aspx">beta</category></item><item><title>Audio3D Sample Posted</title><link>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/23/audio3d-sample-posted.aspx</link><pubDate>Fri, 23 Nov 2007 23:21:00 GMT</pubDate><guid isPermaLink="false">f079997d-67b3-4d49-aaea-86507d683840:13</guid><dc:creator>admin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://ilovevb.net/Web/blogs/vbxna/rsscomments.aspx?PostID=13</wfw:commentRss><comments>http://ilovevb.net/Web/blogs/vbxna/archive/2007/11/23/audio3d-sample-posted.aspx#comments</comments><description>&lt;p&gt;This one took a bit of reworking when the 2.0 beta bits came out, but it&amp;#39;s all set now.&amp;nbsp; One thing that was different in 2.0 is the inclusion of a content project, instead of just a folder, and the old sound content wouldn&amp;#39;t load in the new project, so I had to regrab the files. If you crack open the audio.xap file, you&amp;#39;ll see the Version number is 16 now.&lt;/p&gt;
&lt;p&gt;One of the other snags I ran into, that may have been my own error, but took a while to figure out was that my content project was targeting an xbox instead of PC.&amp;nbsp; Once I figured that out, everything ran fine.&lt;/p&gt;
&lt;p&gt;Anyway, you can grab the Audio3D sample &lt;a class="" href="http://ilovevb.net/Web/files/folders/samples/entry12.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://ilovevb.net/Web/aggbug.aspx?PostID=13" width="1" height="1"&gt;</description><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/xna/default.aspx">xna</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/vb.net/default.aspx">vb.net</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/Audio/default.aspx">Audio</category><category domain="http://ilovevb.net/Web/blogs/vbxna/archive/tags/3D/default.aspx">3D</category></item></channel></rss>
