<?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: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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Crappy Coding</title>
	
	<link>http://www.crappycoding.com</link>
	<description>Spreading the Geek</description>
	<lastBuildDate>Wed, 11 Aug 2010 11:46:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CrappyCoding" /><feedburner:info uri="crappycoding" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Some Sugar with your Syntax?</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/jpdUz8g84C4/</link>
		<comments>http://www.crappycoding.com/2010/08/some-sugar-with-your-syntax/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:43:35 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Crappy Code]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=272</guid>
		<description>In the tutorial recently posted, I created the render state objects using some old-school syntax.

[csharp]
StencilAlways = new DepthStencilState();
StencilAlways.StencilEnable = true;
StencilAlways.StencilFunction = CompareFunction.Always;
StencilAlways.StencilPass = StencilOperation.Replace;
StencilAlways.ReferenceStencil = 1;
StencilAlways.DepthBufferEnable = false;
[/csharp]

You can do this in a much better way nowadays.

[csharp]
StencilAlways = new DepthStencilState()
{
  StencilEnable = true,
  StencilFunction = CompareFunction.Always,
  StencilPass = StencilOperation.Replace,
  ReferenceStencil = 1,
  DepthBufferEnable = false
};


I've seen this syntax before, but 20 years of habits die hard and I rarely remember to use it. Hopefully it will stick now, and make my crappy code that much less crappy.


[/csharp]&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/jpdUz8g84C4" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/08/some-sugar-with-your-syntax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/08/some-sugar-with-your-syntax/</feedburner:origLink></item>
		<item>
		<title>Texture Modification using Render Targets, with some Stencil Buffer Action</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/QZJyLWCZ__A/</link>
		<comments>http://www.crappycoding.com/2010/08/texture-modification-using-render-targets-with-some-stencil-buffer-action/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 04:31:01 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[WP7DEV]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[XNA 4.0]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=253</guid>
		<description>Sometimes you need to modify a texture while your game is running, and there are a number of ways to do this. One of the first things newer game programmers often try to do is use Texture2D.GetData to copy the texture data from the GPU to an array on the CPU, modify the bytes, and then send it back to the GPU with Texture2D.SetData.

This is a bad idea on many, levels. Beyond issues with pipeline stalls, GetData and SetData can be slow, especially when working with a large texture. Any time you’re tempted grab data from the GPU for use on the CPU you should very carefully consider all of your options. There are often other solutions that let you keep the data entirely on the GPU and accomplish the same thing.

This tutorial will use an example that could be solved with GetData and SetData, and show you another alternative using render targets and the stencil buffer that will let you perform the same function entirely on the GPU.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/QZJyLWCZ__A" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/08/texture-modification-using-render-targets-with-some-stencil-buffer-action/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/08/texture-modification-using-render-targets-with-some-stencil-buffer-action/</feedburner:origLink></item>
		<item>
		<title>Past Lives</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/DY_8RuSRrG4/</link>
		<comments>http://www.crappycoding.com/2010/08/past-lives/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 01:10:07 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Ramblings]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=238</guid>
		<description>I've taken a bit of a programming hiatus so far this summer, with the exception of the WordPress plugin I mentioned last time which I just spent a couple hours a week on over the past several months.  Kind of taking a deep breath before plunging into making a game for the upcoming Windows Phone 7.  During my break I've spent some time thinking about some of the projects I've worked on over the years - some that I've hated, and some that I've loved.  One that always stands out for me is a little something called MariusNet, and I thought I'd share the story.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/DY_8RuSRrG4" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/08/past-lives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/08/past-lives/</feedburner:origLink></item>
		<item>
		<title>WordPress Plugin Diversion</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/vozql-cBzis/</link>
		<comments>http://www.crappycoding.com/2010/07/wordpress-plugin-diversion/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:12:13 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=235</guid>
		<description>Earlier this year I started doing some daily walking and hiking.  I would be remiss if I didn't tie some technology into it somehow, so in my spare time I've been working on a WordPress plugin to track my progress.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/vozql-cBzis" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/07/wordpress-plugin-diversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/07/wordpress-plugin-diversion/</feedburner:origLink></item>
		<item>
		<title>Uninstalling Windows Phone Developer Tools CTP</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/A9kGfGkAbg4/</link>
		<comments>http://www.crappycoding.com/2010/07/uninstalling-windows-phone-developer-tools-ctp/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 00:27:37 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=230</guid>
		<description>Like many others it seems, when uninstalling the Windows Phone Dev Tools CTP I uninstalled each of the individual components before getting to the actual "Microsoft Windows Phone Developer Tools CTP - ENU".  When this happens the uninstall doesn't work, unless you first re-install everything else.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/A9kGfGkAbg4" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/07/uninstalling-windows-phone-developer-tools-ctp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/07/uninstalling-windows-phone-developer-tools-ctp/</feedburner:origLink></item>
		<item>
		<title>Procedural Planet Video</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/iGBkFBvnRdU/</link>
		<comments>http://www.crappycoding.com/2010/01/procedural-planet-video/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 18:31:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Procedural Planet]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=221</guid>
		<description>Procedural Planet video showing the space-to-surface transition, as well as the tank driving around a bit. I'm pretty happy with how it looks, but there are a lot of things that still need to be fixed.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/iGBkFBvnRdU" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/01/procedural-planet-video/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/01/procedural-planet-video/</feedburner:origLink></item>
		<item>
		<title>Of Tanks and Quad Trees</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/cHI9VCKRtiE/</link>
		<comments>http://www.crappycoding.com/2010/01/of-tanks-and-quad-trees/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 19:50:40 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Procedural Planet]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=214</guid>
		<description>I needed a bit of a diversion from the planet rendering itself, into something that would give some purpose behind it. Why is the planet there?  Well, what better use is there for a planet than driving a tank on it?&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/cHI9VCKRtiE" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/01/of-tanks-and-quad-trees/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/01/of-tanks-and-quad-trees/</feedburner:origLink></item>
		<item>
		<title>GPU Geometry Map Rendering – Part 2</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/lyi3HEePpsk/</link>
		<comments>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-%e2%80%93-part-2/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 06:27:28 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[Procedural Planet]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=193</guid>
		<description>We left off in part 1 talking about the initial failures with my GPU geometry map shader. I did fail to mention that there was a bright spot the first time I ran the new code – it was amazingly fast. So fast I was able to increase the noise octaves from the 5 that would run reasonably well on the CPU up to 30 and still run at well over 60fps. I have to admit that I spent some of that first 18 hour day just roaming around on a barren, reddish planet. That huge improvement in performance made the pain to come well worth it.
So, at the end of part 1 we set up the C# code for executing the geometry map shader.  Now let’s take a look at the shader itself.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/lyi3HEePpsk" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-%e2%80%93-part-2/</feedburner:origLink></item>
		<item>
		<title>GPU Geometry Map Rendering – Part 1</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/lTU2hAA2Yuo/</link>
		<comments>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-part-1/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 03:38:42 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Procedural Planet]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=143</guid>
		<description>I spent the past week moving my procedural planet renderer’s
geometry map creation code from the CPU to the GPU. It didn’t go as smoothly as
I would have liked, but in a way that was a good thing since I gained a much
deeper understanding of some render pipeline things that I had been taking for
granted.&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/lTU2hAA2Yuo" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/01/gpu-geometry-map-rendering-part-1/</feedburner:origLink></item>
		<item>
		<title>Planet Renderer Screenshots</title>
		<link>http://feedproxy.google.com/~r/CrappyCoding/~3/C7tGMsqmgtM/</link>
		<comments>http://www.crappycoding.com/2010/01/planet-renderer-screenshots/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 07:01:46 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Procedural Planet]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planet]]></category>
		<category><![CDATA[procedural]]></category>

		<guid isPermaLink="false">http://www.crappycoding.com/?p=134</guid>
		<description>Going to write up something useful tomorrow, but for now here are a few screenshots&amp;#8230;&lt;img src="http://feeds.feedburner.com/~r/CrappyCoding/~4/C7tGMsqmgtM" height="1" width="1"/&gt;</description>
		<wfw:commentRss>http://www.crappycoding.com/2010/01/planet-renderer-screenshots/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.crappycoding.com/2010/01/planet-renderer-screenshots/</feedburner:origLink></item>
	</channel>
</rss>
