<?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>Sgt. Conker &#187; MVP Watch</title>
	<atom:link href="http://www.sgtconker.com/category/general/mvp-watch/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtconker.com</link>
	<description>We are &#34;absolutely fine&#34;</description>
	<lastBuildDate>Wed, 06 Jul 2011 13:29:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ignoring a Hidden Clingerman to Visit Germany</title>
		<link>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/</link>
		<comments>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 13:29:44 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[#BoatForGeorge]]></category>
		<category><![CDATA[Jim Perry]]></category>
		<category><![CDATA[Roland Rosenkranz]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/</guid>
		<description><![CDATA[Looks like there were a new addition to the league of XNA/DirectX (didn’t that read DirectX/XNA once?) MVPs: the German Roland “Glatzemann” Rosenkranz, who is running amokcausing havockeeping posting on the XNA.mag and our beloved AppBuh forums. Congratulations, chap!
Meanwhile, in Jim “So Evil That Even George Ducks and Covers” Perry-land the Overlocker himself continues to [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like there were a new addition to the league of <a href="https://mvp.support.microsoft.com/communities/mvp.aspx?product=1&amp;competency=XNA%2fDirectX">XNA/DirectX (didn’t that read DirectX/XNA once?) MVPs</a>: the German <a href="http://www.mitohnehaare.de/">Roland “Glatzemann” Rosenkranz</a>, who is <strike>running amokcausing havoc</strike>keeping posting on the <a href="http://www.xnamag.de/">XNA.mag</a> and our beloved <a href="http://forums.create.msdn.com/forums/">AppBuh forums</a>. Congratulations, chap!</p>
<p>Meanwhile, in <a href="http://machxgames.com/blog/">Jim “So Evil That Even George Ducks and Covers” Perry</a>-land the Overlocker himself continues to spam his blog. This time, he covers <a href="http://machxgames.com/blog/?p=50">Spy Game Design – Multiplatform Issues/Capability</a> and <a href="http://machxgames.com/blog/?p=51">Spy Game Design – Character Training</a>. Lets see if he can keep up the pace while <a href="http://www.xnadevelopment.com/">The Hidden One</a> continues to, well, hide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/07/ignoring-a-hidden-clingerman-to-visit-germany/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Posing a Clingerman to Welcome Our New Overlords</title>
		<link>http://www.sgtconker.com/2011/04/posing-a-clingerman-to-welcome-our-new-overlords/</link>
		<comments>http://www.sgtconker.com/2011/04/posing-a-clingerman-to-welcome-our-new-overlords/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 06:16:56 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[John Defenbaugh]]></category>
		<category><![CDATA[Michael B. McLaughlin]]></category>
		<category><![CDATA[MVP]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2011/04/posing-a-clingerman-to-welcome-our-new-overlords/</guid>
		<description><![CDATA[That’s right: George W. Clingerman finally stopped pretending being a developer/programmer/someone who knows code to pursue a career as DJ now, going by the nick DJ Cling-Star. Meanwhile, there are three new additions to the happy bunch that is known as the Direct/XNA MVPs:
First, there’s Michael B. “Concise” McLaughlin of Bob Taco Industries fame. Expect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sgtconker.com/wp-content/uploads/2011/04/DJ-Cling-Star.jpg"><img style="background-image: none; border-right-width: 0px; margin: 0px 8px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="DJ Cling-Star" border="0" alt="DJ Cling-Star" align="left" src="http://www.sgtconker.com/wp-content/uploads/2011/04/DJ-Cling-Star_thumb.jpg" width="244" height="184" /></a>That’s right: <a href="http://www.xnadevelopment.com/">George W. Clingerman</a> finally stopped pretending being a developer/programmer/someone who knows code to pursue a career as DJ now, going by the nick DJ Cling-Star. Meanwhile, there are three new additions to the happy bunch that is known as the Direct/XNA MVPs:</p>
<p style="overflow: hidden"><a href="http://www.sgtconker.com/wp-content/uploads/2011/04/mikebmcl-thumb.png"><img style="background-image: none; border-right-width: 0px; margin: 0px 8px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="mikebmcl thumb" border="0" alt="mikebmcl thumb" align="left" src="http://www.sgtconker.com/wp-content/uploads/2011/04/mikebmcl-thumb_thumb.png" width="56" height="66" /></a>First, there’s <a title="Even an army of monkeys fail to keep up with his word count…" href="http://geekswithblogs.net/mikebmcl/Default.aspx">Michael B. “Concise” McLaughlin</a> of <a href="http://www.bobtacoindustries.com/">Bob Taco Industries</a> fame. Expect even more words coming from this man and his <a href="http://geekswithblogs.net/mikebmcl/Default.aspx">blog</a> (and now <em>his</em> <a href="http://forums.create.msdn.com/forums/p/80085/484493.aspx#484493">forums</a>).</p>
<p style="overflow: hidden"><a href="http://twitter.com/#!/sigilxna"><img style="background-image: none; border-right-width: 0px; margin: 0px 8px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="The Pale Impaled Thumb" border="0" alt="The Pale Impaled Thumb" align="left" src="http://www.sgtconker.com/wp-content/uploads/2011/04/The-Pale-Impaled-Thumb.jpg" width="56" height="66" /></a>Next up comes the <a title="The Texan" href="http://youtube.com/SigilXNA">John “The Pale Impaled” Defenbaugh</a>, joining <a title="Also know as “One Word”" href="http://twitter.com/#!/MachXGames">Jim “The Closer” Perry</a>, armed with his <strike>shut gun</strike><em>shotgun</em> the threads <em>will</em> fall left and right like clay pigeons. <a href="http://twitter.com/#!/SigilXNA/status/56500927221334017">Luckily he still ain’t havin’ the permissions</a>.</p>
<p><a href="http://www.armlessoctopus.com/2011/04/08/get-to-know-your-xna-mvps-part-1-what-is-an-mvp/">The third one is MIA currently</a>… <em>[<strong>Update</strong>: OK, our <strike>intelligent</strike>intelligence services managed to get ahold of his name now, <a href="https://mvp.support.microsoft.com/profile=236BF14F-6C6D-47F9-BC11-7C0AD6E36E30">Dr. Minh-Triet TRAN</a>, but not many more details…]</em></p>
<p>Lets hope <strike>this</strike><em>these</em> guys can fulfill the <a href="http://geekswithblogs.net/clingermangw/archive/2011/04/08/144771.aspx#572933"><strong><em>demands</em></strong> of the community</a>…</p>
<p><em>[<strong>Update:</strong> <a title="The previous sentence resulted in mental damage and has since been deleted to prevent any further damage" href="http://twitter.com/#!/madNinjaSkillz">Moo</a>]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2011/04/posing-a-clingerman-to-welcome-our-new-overlords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Words And Pages</title>
		<link>http://www.sgtconker.com/2010/06/words-and-pages/</link>
		<comments>http://www.sgtconker.com/2010/06/words-and-pages/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 18:22:29 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Chris G. Williams]]></category>
		<category><![CDATA[George W. Clingerman]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/06/words-and-pages/</guid>
		<description><![CDATA[The Great Quiet is over in XNA MVP land as Chris G. “Avatar” Williams and George W. “Vatara” Clingerman break the news about their collaboration on the pamphletupcoming bestseller aptly titled “Professional Windows Phone 7 Game Development: Creating Games using XNA Game Studio 4”.
Meanwhile Andy “Ratava” Dunn ponders self publishing, asking for feedback.
]]></description>
			<content:encoded><![CDATA[<p>The <em>Great Quiet</em> is over in XNA MVP land as <a href="http://www.blogusmaximus.net/">Chris G. “Avatar” Williams</a> and <a href="http://www.xnadevelopment.com/">George W. “Vatara” Clingerman</a> break the news about their collaboration on the <strike>pamphlet</strike><em>upcoming bestseller</em> aptly titled “<a title="Like Microsoft themself, their MVPs like precise titles…" href="http://www.amazon.com/Professional-Windows-Phone-Game-Development/dp/0470922443/ref=sr_1_10?ie=UTF8&amp;s=books&amp;qid=1276965435&amp;sr=1-10">Professional Windows Phone 7 Game Development: Creating Games using XNA Game Studio 4</a>”.</p>
<p>Meanwhile <a href="http://thezbuffer.com/">Andy “Ratava” Dunn</a> <a title="No title" href="http://www.indiegameguy.com/blogs/zman/archive/2010/06/21/writing-a-book.aspx">ponders self publishing</a>, asking for feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/06/words-and-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not so Breaking News</title>
		<link>http://www.sgtconker.com/2010/05/not-so-breaking-news/</link>
		<comments>http://www.sgtconker.com/2010/05/not-so-breaking-news/#comments</comments>
		<pubDate>Wed, 26 May 2010 09:28:02 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Catalin Zima]]></category>
		<category><![CDATA[Shawn Hargreaves]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1470</guid>
		<description><![CDATA[…anymore anyway as even the sleepiest, under a rock living member of the XNA community will already know that our beloved local MVP extraordinary Catalin Zima got married the last weekend. Although life in the barracks is still on halt due to the impact of the party (albeit of the virtual form only) we like [...]]]></description>
			<content:encoded><![CDATA[<p>…anymore anyway as even the sleepiest, under a rock living member of the XNA community will already know that our beloved local MVP extraordinary <a href="http://www.catalinzima.com/">Catalin Zima</a> <a href="http://www.catalinzima.com/?p=597">got married the last weekend</a>. Although life in the barracks is still on halt due to the impact of the party (albeit of the virtual form only) we like to share our congratulations with Catalin. So, here it comes: <strong><em>Congratulations, dude!</em></strong> (spectacular, ain’t it?)</p>
<p>In related news: <a href="http://blogs.msdn.com/b/shawnhar/">Shawn Hargreaves</a> <a href="http://blogs.msdn.com/b/shawnhar/archive/2010/05/25/not-dead-yet.aspx">put a ring on it (the ring finger)</a>, too, so we use this opportunity to also <em><strong>congratulate The Shawn!</strong></em></p>
<p>P.S.: We place our bets on <a href="http://thezbuffer.com/">Andy Dunn</a> to be the next to take the chance…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/05/not-so-breaking-news/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Silent And Quiet</title>
		<link>http://www.sgtconker.com/2010/05/silent-and-quiet/</link>
		<comments>http://www.sgtconker.com/2010/05/silent-and-quiet/#comments</comments>
		<pubDate>Thu, 13 May 2010 17:50:47 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Charles Humphrey]]></category>
		<category><![CDATA[Chris G. Williams]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Vincente Cartas]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/05/silent-and-quiet/</guid>
		<description><![CDATA[It’s been some time since the last MVP Watch and it doesn’t seem that much has been missed…
Anyway, George W. “Bugbear” Clingerman feels unhated and so did Vincente “Bête Noire” Cartas, Chris G. “Daggers Drawn” Williams started something, Andy “Jealous as a Barbary Pigeon” Dunn likes to do the opposite, Charles “Demoniacal” Humphrey ain’t impressed, [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been some time since the last MVP Watch and it doesn’t seem that much has been missed…</p>
<p>Anyway, <a href="http://www.xnadevelopment.com/">George W. “Bugbear” Clingerman</a> <a title="Express your hate of this poor chap now!" href="http://twitter.com/clingermangw/status/13729089245">feels unhated</a> and <a title="We hate him. Do you?" href="http://twitter.com/VicenteCartas/status/13729500268">so did</a> <a href="http://kartones.net/blogs/jadengine">Vincente “Bête Noire” Cartas</a>, <a href="http://www.blogusmaximus.net/">Chris G. “Daggers Drawn” Williams</a> <a title="This actually makes it hard to hate this lad but we always prefer the hard job!" href="http://twitter.com/chrisgwilliams/status/13739997883">started something</a>, <a href="http://thezbuffer.com/">Andy “Jealous as a Barbary Pigeon” Dunn</a> <a title="And we hate this laddie for doing so!" href="http://twitter.com/The_Zman/status/13457334932">likes to do the opposite</a>, <a href="http://xna-uk.net/blogs/randomchaos">Charles “Demoniacal” Humphrey</a> <a title="We hate him." href="http://twitter.com/NemoKrad/status/13812012063">ain’t impressed</a>, <a href="http://machaira.spaces.live.com/">Jim “Philophilosophos” Perry</a>&#160;<a title="We cannot help but love this dude." href="http://twitter.com/MachXGames/status/13723767918">reviews movies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/05/silent-and-quiet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Words And Easy</title>
		<link>http://www.sgtconker.com/2010/04/words-and-easy/</link>
		<comments>http://www.sgtconker.com/2010/04/words-and-easy/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 06:00:50 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Catalin Zima]]></category>
		<category><![CDATA[Charles Humphrey]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Glenn Wilson]]></category>
		<category><![CDATA[Richard Thomson]]></category>
		<category><![CDATA[Vincente Cartas]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/04/words-and-easy/</guid>
		<description><![CDATA[Richard “Craigellachie” Thomson writes code. Vincente “Tomintoul” Cartas will talk about XNA. Charles “Dufftown” Humphrey writes about code (supposedly Catalin “Linkwood” Zima was in charge to read what was written about code…) and is a lobster.
George W. “Knockando” Clingerman shares links, has a heart of gold and is in good company.
Glenn “Miltonduff” Wilson returns to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://legalizeadulthood.wordpress.com/">Richard “Craigellachie” Thomson</a> <a title="A MVP writing code? No way!!1" href="http://twitter.com/legalizeadulthd/status/12311942117">writes code</a>. <a href="http://kartones.net/blogs/jadengine/">Vincente “Tomintoul” Cartas</a> <a title="There we have it again: MVP is all about being vocal :)" href="http://twitter.com/VicenteCartas/status/12337185278">will talk about XNA</a>. <a href="http://xna-uk.net/blogs/randomchaos">Charles “Dufftown” Humphrey</a> <a title="MVPs do what MVPs do." href="http://www.sgtconker.com/?p=1407">writes about code</a> (supposedly <a href="http://www.catalinzima.com/">Catalin “Linkwood” Zima</a> <a title="…but at the time of this writing the article was still unpublished." href="http://twitter.com/CatalinZima/status/12234234625">was in charge to read what was written about code…</a>) and <a title="Like any other Englishman" href="http://twitter.com/NemoKrad/status/12364194407">is a lobster</a>.</p>
<p><a href="http://www.xnadevelopment.com/">George W. “Knockando” Clingerman</a> <a title="Yes, he can read!" href="http://twitter.com/clingermangw/status/12324658758">shares links</a>, <a title="Sorry, gals, he’s already married." href="http://twitter.com/clingermangw/status/12372887265">has a heart of gold</a> and <a title="He’s the next CliffyB, not that Silva dude!!1" href="http://oxmonline.com/article/features/mag/oxm-vs-xna?page=0%2C1">is in good company</a>.</p>
<p><a href="http://www.virtualrealm.com.au/">Glenn “Miltonduff” Wilson</a> <a title="Welcome back!" href="http://twitter.com/Mykre/status/12374309087">returns to XNA</a> while <a href="http://thezbuffer.com/">Andy “Inchgower” Dunn</a> <a title="Crazy Englishman." href="http://www.indiegameguy.com/blogs/zman/archive/2010/04/23/recovery.aspx">keeps on</a> <a title="Yeah, where? WHERE?!" href="http://www.last.fm/music/Lenny+Kravitz/_/Where+Are+We+Runnin'%3F">runnin’</a>.</p>
<p><em>Ed. <a title="I need to rethink my career…" href="http://www.last.fm/music/Megadeth/Killing+Is+My+Business...And+Business+Is+Good!/Killing+Is+My+Business...and+Business+Is+Good!">Stalking is my business and business is bad</a>. <a title="Cow Zen: rumination is meditation!" href="http://images.google.de/images?q=&quot;the+cow+abides&quot;&amp;hl=en">Moo</a>?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/words-and-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Article : Sun- and Lens Flare as a Post Process</title>
		<link>http://www.sgtconker.com/2010/04/article-sun-and-lens-flare-as-a-post-process/</link>
		<comments>http://www.sgtconker.com/2010/04/article-sun-and-lens-flare-as-a-post-process/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 12:12:01 +0000</pubDate>
		<dc:creator>NemoKrad</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Post Processing]]></category>
		<category><![CDATA[Shaders]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Blacksun]]></category>
		<category><![CDATA[Charles Humphrey]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Lens flare]]></category>
		<category><![CDATA[Post Process]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1407</guid>
		<description><![CDATA[by ]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">by <a href="<a href="http://xna-uk.net/blogs/randomchaos/">Charles Humphrey</a></h4>
<p><img class="alignright" src="http://sgtconker.com/wp-content/uploads/2010/04/sunpostprocess.png" alt="" width="264" height="206" /></p>
<p>Now this sample has come from my current XNA toy which is the Blacksun engine I am currently writing in XNA 3.1. It uses deferred lighting, instancing and a post processing framework that I found on a great site <a href="http://graphicsrunner.blogspot.com/2008/06/post-process-framework-sample.html">here</a>, all I had to do was make it engine ready.</p>
<p>If you want to have a look at the effect in the engine you can see it <a href="http://www.youtube.com/watch?v=DrhF2Bp-95I">here</a>.</p>
<p>This sample is just one of the elements from the post processing framework in the engine, there are none of the other goodies in this sample, just the Sun post process. This sample has also been created using the XNA 4.0 CTP, so I only had one render target to work with at the time. This means that you can't see the sun being culled behind objects in the scene as I can't create a depth map as well as the rendered scene, to be honest, I still don't have that bit of the shader 100% anyway <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><span id="more-1407"></span></p>
<p>So, what do you get in this sample, well, the sun shader and the lens flare effect all in one post process and done in XNA 4.0. It's a pretty simple effect really, taking the suns position in the world, then just finding its screen coordinates on the render target and render the sun flare texture, then render the texture again over a set of offset texture coordinates to give the lens flare effect.</p>
<p>Lets take a look at the code...</p>
<p><strong>Sun.fx</strong></p>
<p>We have a few variables we can pass to the shader to control this effect, the names I hope are quite self explanatory, well most of them</p>
<pre class="brush: csharp; title: ;">
float3 cameraPosition;

float SunSize = 1500;

float Density = 3;
float Exposure = -.1;
float Weight = .25;
float Weight2 = .125;
float Decay = .5;

float3 lightPosition;

float lightIntensity = 10.0f;
float3 Color = float3(1,1,1);

texture flare;
sampler Flare = sampler_state
{
    Texture = (flare);
    AddressU = CLAMP;
    AddressV = CLAMP;
};

sampler BackBuffer : register(s0);

//depth
texture depthMap;
sampler depthSampler = sampler_state
{
    Texture = (depthMap);
};

struct VertexShaderInput
{
    float3 Position : POSITION0;
    float2 texCoord : TEXCOORD0;
};

struct VertexShaderOutputToPS
{
    float2 texCoord : TEXCOORD0;
};
</pre>
<p>Those that I guess are not that obvious are Density to Decay and these relate the the lens flare part of the shader and control the number of texture samples to display, density of those samples etc..</p>
<p>So onto the lane flare function that is used in the shader to give the lens flare effect.</p>
<pre class="brush: csharp; title: ;">
float4 DoLenseFlare(float4 ScreenLightPosition,float2 texCoord,bool fwd)
{
    // Calculate vector from pixel to light source in screen space.
    float2 deltaTexCoord = (texCoord - ScreenLightPosition.xy);// Divide by number of samples and scale by control factor.
    deltaTexCoord *= 1.0f / 3 * Density;

    // Store initial sample.
    float3 color = 0;

    // Set up illumination decay factor.
    float illuminationDecay = 1.0f;

    for (int i = 0; i &amp;lt; 3 ; i++)
    {
        // Step sample location along ray.
        if(fwd)
            texCoord -= deltaTexCoord;
        else
            texCoord += deltaTexCoord;

        // Retrieve sample at new location.
        float3 sample = tex2D(Flare, texCoord);

        // Apply sample attenuation scale/decay factors.
        if(fwd)
            sample *= illuminationDecay * Weight;
        else
            sample *= illuminationDecay * Weight2;

        // Accumulate combined color.
        color += sample;

        // Update exponential decay factor.
        illuminationDecay *= Decay;
    }

    return float4(color,1);
}
</pre>
<p>I can take very little credit for this bit of the code, as I got it from GPU Game 3 Chapter 13 Volumetric Light Scattering as a Post Process, not exactly using it as it was intended, but is does the job I wanted here well enough <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So the pixel shader itself that pulls this all together looks like this</p>
<pre class="brush: csharp; title: ;">
float4 PixelShaderFunction(VertexShaderOutputToPS input) : COLOR0
{
    // Get the scene
    float4 col = tex2D(BackBuffer,input.texCoord);// Find the suns position in the world and map it to the screen space.
    float4 ScreenPosition = mul(lightPosition - cameraPosition,VP);
    float scale = ScreenPosition.z;
    ScreenPosition.xyz /= ScreenPosition.w;
    ScreenPosition.x = ScreenPosition.x/2.0f+0.5f;
    ScreenPosition.y = (-ScreenPosition.y/2.0f+0.5f);

    // get the depth from the depth map
    //float depthVal = 1- tex2D(depthSampler, input.texCoord).r;

    // Are we lokoing in the direction of the sun?
    if(ScreenPosition.w &gt; 0)
    {
        float2 coord;

        float size = SunSize / scale;

        float2 center = ScreenPosition.xy;

        coord = .5 - (input.texCoord - center) / size * .5;

        //if(depthVal &gt; ScreenPosition.z-.0003)
        col += (pow(tex2D(Flare,coord) * float4(Color,1),2) * lightIntensity) * 2;

        // Lens flare
        col += ((DoLenseFlare(ScreenPosition,input.texCoord,true) + DoLenseFlare(ScreenPosition,input.texCoord,false)) * float4(Color,1) * lightIntensity) * 5;
    }

    return col;
}
</pre>
<p>You will see in here that I have left in the code for detecting the depth of objects in the scene for sun culling and just commented it out, when you have a full release XNA 4.0 you will be able to create and pass in the depth map, but it’s not possible in the current CTP.</p>
<p>So what am I doing in the pixel shader, first off we grab the current scene’s color, I then get the position of the light in screen space by multiplying its position by the camera position and then doing the homogeneous divide (ScreenPosition.xyz / ScreenPosition.w) to get the position of the sun (see the Get2DCoords method below for my inspiration for this). Then, if we are looking in the direction of the sun (ScreenPosition.w &gt; 0) then we need to render the sun and or lens flare. I then calculate the size of the sun and find the tex coords required to get the texture from the Flare sampler and then add this with the sun color and raise it to the power of 2, this lightens the light bits and darkens the dark bits, this is then multiplied by the light intensity and the final values doubled again. Then we come to the lens flare, I call this twice: once for each direction of the flare (you will see in the clip there are two) and again tint this to the sun color and multiply by intensity.</p>
<p>Now please feel free to pick my dodgy math’s apart here I know I suck, but it is working and I have not thought much more abut it since writing it <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><strong>Game Code</strong></p>
<p>First thing we will do is set up a render target and and effect so we can apply our sun as a post process.</p>
<pre class="brush: csharp; title: ;">
RenderTarget2D rt;
Effect effect;
</pre>
<p>Also some way of representing the sun’s position, color intensity and size</p>
<pre class="brush: csharp; title: ;">
Vector3 sunPosition = new Vector3(100, 200, -1000);
Color sunColor = Color.White;
float sunIntensity = 1f;
float sunSunSize = 1500;
</pre>
<p>Now we have these variable lined up and ready to use we can initialize both the render target and the effect shader</p>
<pre class="brush: csharp; title: ;">
rt = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

effect = Content.Load&lt;Effect&gt;(&quot;Shaders/PostProcessing/Sun&quot;);
effect.Parameters[&quot;flare&quot;].SetValue(Content.Load&lt;Texture2D&gt;(&quot;Textures/PostProcessing/flare&quot;));
effect.Parameters[&quot;Color&quot;].SetValue(sunColor.ToVector3());
effect.Parameters[&quot;lightIntensity&quot;].SetValue(sunIntensity);
effect.Parameters[&quot;SunSize&quot;].SetValue(sunSunSize);
effect.Parameters[&quot;lightPosition&quot;].SetValue(sunPosition);
</pre>
<p>Now we need to make sure the shader/effect is updated with the required variables. So in our update method we set the following parameters</p>
<pre class="brush: csharp; title: ;">
effect.Parameters[&quot;VP&quot;].SetValue(camera.View * camera.Projection);
effect.Parameters[&quot;cameraPosition&quot;].SetValue(camera.Position);
//effect.Parameters[&quot;depthMap&quot;].SetValue(depthBuffer);
</pre>
<p>And now for the render, keep in mind that this is all done just for this sample, you will want to encapsulate all this in its own class deriving from DrawableGameComponent or in a post processing framework as shown in the link above.</p>
<pre class="brush: csharp; title: ;">
    GraphicsDevice.SetRenderTargets(rt);
    GraphicsDevice.Clear(&lt;Color.Black);
    base.Draw(gameTime);

    // Post Processing.
    GraphicsDevice.SetRenderTargets(null);

    GraphicsDevice.Textures[0] = rt;
    spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
    effect.Techniques[0].Passes[0].Apply();
    spriteBatch.Draw(rt, new Rectangle(0, 0, rt.Width, rt.Height), Color.White);
    spriteBatch.End();
</pre>
<p>So, we setup the render target, allow the scene to be drawn (nothing gets drawn in this sample), then we resolve the render target and then apply our effect to the newly captured render target.</p>
<p>As mentioned earlier I have a method I use to get screen coordinates from a 3D screen position, this method I am 99% sure I got (or at least the nuts and bolts of it) from Rocket Commander which was written by <a href="http://exdream.com/Games/Default.aspx?Game=RocketCommander&amp;Category=Open%20Source">Benjamin Nitsche</a></p>
<pre class="brush: csharp; title: ;">
public Vector2 Get2DCoords(Vector3 myPosition, Base3DCamera Camera)
{
    Matrix ViewProjectionMatrix = Camera.View * Camera.Projection;
    Vector4 result4 = Vector4.Transform(myPosition, ViewProjectionMatrix);

    if(result4.W &lt;= 0)
        return new Vector2(Camera.Viewport.Width, 0);

    Vector3 result = new Vector3(result4.X / result4.W, result4.Y / result4.W, result4.Z / result4.W);

    Vector2 retVal = new Vector2((int)Math.Round(+result.X * (Camera.Viewport.Width / 2)) + (Camera.Viewport.Width / 2), (int)Math.Round(-result.Y * (Camera.Viewport.Height / 2)) + (Camera.Viewport.Height / 2));

    return retVal;
}
</pre>
<p>As you can see it transforms the position by the ViewProjection matrix to then get the screen position if the result4.W &gt;= 0.</p>
<p><a href="http://www.sgtconker.com/Downloads/articles/RandomchaosSunPostProcess.zip">Download the sample project here</a><br />
Well that’s abut it, and this is my first post on Sgt Conker, hope it’s not my last one <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Hope you find this useful, if not in it’s own right, then I hope it gives you some ideas for your own shaders…..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/article-sun-and-lens-flare-as-a-post-process/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Bacon And Blood</title>
		<link>http://www.sgtconker.com/2010/04/bacon-and-blood/</link>
		<comments>http://www.sgtconker.com/2010/04/bacon-and-blood/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 14:37:06 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Catalin Zima]]></category>
		<category><![CDATA[Chris G. Williams]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Glenn Wilson]]></category>
		<category><![CDATA[Joel Martinez]]></category>
		<category><![CDATA[John Sedlak]]></category>
		<category><![CDATA[Pieter Germishuys]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/04/bacon-and-blood/</guid>
		<description><![CDATA[Catalin “Belgian Blue” Zima reflects about his 2009. Glenn “Gloucester” Wilson samples the touches, George G. “Dølafe” Clingerman touches the samples and Joel “Gloucester” Martinez touches smoothly.
Meanwhile, on a Saturday night at 2:20 Pieter “Dajal” Germishuys talks about drinking coffee. The day after Andy “Blonde d'Aquitaine” Dunn runs 50 miles.
Chris G. “Red Angus” Williams fears [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.catalinzima.com/">Catalin “Belgian Blue” Zima</a> <a title="Saves me some work" href="http://www.catalinzima.com/?p=592">reflects about his 2009</a>. <a href="http://www.virtualrealm.com.au/">Glenn “Gloucester” Wilson</a> <a title="It&#39;s all about the phone" href="http://www.virtualrealm.com.au/blogs/xna-and-windows-phone-7-touch-sample/">samples the touches</a>, <a href="http://www.xnadevelopment.com/">George G. “Dølafe” Clingerman</a> <a title="Someone stays current" href="http://geekswithblogs.net/clingermangw/archive/2010/04/03/139075.aspx">touches the samples</a> and <a href="http://codecube.net/">Joel “Gloucester” Martinez</a> <a title="…and more phone" href="http://codecube.net/2010/04/smooth-control-with-touch/">touches smoothly</a>.</p>
<p>Meanwhile, on a Saturday night at <span title="That’s A.M., kids!">2:20</span> <a href="http://www.pieterg.com/">Pieter “Dajal” Germishuys</a> <a title="To coffee: The answer to all questions (eventually)." href="http://twitter.com/pgermishuys/statuses/11963125482">talks about</a> <a title="Best way to consume that ambrosia" href="http://twitter.com/pgermishuys/statuses/11963138350">drinking coffee</a>. The day after <a href="http://thezbuffer.com/">Andy “Blonde d'Aquitaine” Dunn</a> <a title="Running Man? Forrest Gump? No! It&#39;s The Zman!" href="http://twitter.com/The_Zman/statuses/12020245402">runs 50 miles</a>.</p>
<p>Chris G. “Red Angus” Williams <a title="Phobias for the win!" href="http://twitter.com/chrisgwilliams/status/12162665277">fears small people</a>, <a title="…or so it seems" href="http://twitter.com/chrisgwilliams/status/12162797249">frags for charity</a> and <a href="http://www.xnadevelopment.com/">Goerge W. “Dølafe” Clingerman</a> <a title="Even if it was building on Nicks code “only”" href="http://twitter.com/clingermangw/statuses/12165181561">downplays his contribution</a>.</p>
<p><a href="http://jsedlak.com/">John “Wagyū” Sedlak</a> <a title="We suggest coffee" href="http://twitter.com/jsedlak/status/12165159539">needs</a>.</p>
<p><em>[Ed.: Somehow the relevance of the subjects actions of this very series is not what it used to be, resulting in a sort of dilemma of what to actually share here. Today's nick names ain’t the most inspired either…]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/bacon-and-blood/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Memories And Kharma</title>
		<link>http://www.sgtconker.com/2010/04/memories-and-kharma/</link>
		<comments>http://www.sgtconker.com/2010/04/memories-and-kharma/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 18:09:49 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Catalin Zima]]></category>
		<category><![CDATA[Chad Carter]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Joel Martinez]]></category>
		<category><![CDATA[Pieter Germishuys]]></category>
		<category><![CDATA[Richard Fine]]></category>
		<category><![CDATA[Vincente Cartas]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/04/memories-and-kharma/</guid>
		<description><![CDATA[Joel “Edmund” Martinez knows how to finish a game with XNA, while Andy “Earl of Gloucester” Dunn still tries to establish this “common sense” thing on the forums.
Intermission: most of the personas featured in this series are part of the preferable category mentioned at The Problem With MVPs – and, frankly, I cannot name one [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codecube.net/">Joel “Edmund” Martinez</a> <a title="…and he gives away his knowledge!" href="http://codecube.net/2010/03/xna-slides-from-orlando-codecamp-2010/">knows how to finish a game with XNA</a>, while <a href="http://thezbuffer.com/">Andy “Earl of Gloucester” Dunn</a> <a title="All hope is lost." href="http://forums.xna.com/forums/p/50052/304832.aspx#304832">still tries to establish this “common sense” thing on the forums</a>.</p>
<p><em>Intermission:</em> most of the personas featured in this series are part of the preferable category mentioned at <a href="http://steverb.com/post/2010/03/24/The-Problem-With-MVPs.aspx">The Problem With MVPs</a> – and, frankly, I cannot name one that would fall into the other category right now…</p>
<p><a href="http://kartones.net/blogs/jadengine">Vincente “Curan” Cartas</a> <a title="I have to remember before I forget…" href="http://kartones.net/blogs/jadengine/archive/2010/03/29/microsfot-mvp-summit-and-mvp-open-day-english.aspx">battens in memories of the MVP Summit</a>, Chad “Oswald” Carter <a title="What happens in the closet stays in the closet. Usually." href="http://twitter.com/kewlniss/statuses/11270833482">repudiates his fetish</a> and Chris G. “Edgar” Williams <a title="Kharma can be such a beast" href="http://twitter.com/chrisgwilliams/statuses/11273508403">meets Kharma</a> and <a title="Kharma stayed over the weekend" href="http://blogusmaximus.net/archive/2010/03/29/138978.aspx">has a Game Design Dilemma</a>, <a title="That should gain a few Kharma points…" href="http://www.ninequestions.net/archive/2010/03/29/nine-questions-with-michelle-juett.aspx">asks Nine Questions</a>.</p>
<p>Meanwhile, <a href="http://www.xnadevelopment.com/">George W. “Fool” Clingerman</a> <a title="He works hard for the money" href="http://twitter.com/clingermangw/status/11309754639">is back at work</a>, <a title="With coffee everything is more or less tolerable." href="http://twitter.com/clingermangw/statuses/11313385711">accepts meetings when there’s coffee</a> and <a title="Do we anyway?" href="http://twitter.com/clingermangw/status/11318721452">doesn’t know who he is</a>. Richard “Caius” Fine <a title="Knowing ones limits is the first step to success." href="http://twitter.com/Superpig/statuses/11319865491">knows himself</a>.</p>
<p><a href="http://www.catalinzima.com/">Catalin “A Herald” Zima</a>&#160;<a title="Congratulations!" href="http://twitter.com/CatalinZima/statuses/11426865419">will be with us for yet another year</a> and <a title="Congratulations, too!" href="http://twitter.com/pgermishuys/statuses/11432308347">so will</a> <a href="http://www.pieterg.com/">Pieter “Old Man” Germishuys</a>. But at the end of the week, only <a href="http://www.xnadevelopment.com/">George W. “Fool” Clingerman</a> <a title="The numbers are the truth" href="http://forums.xna.com/forums/p/50828/306812.aspx">counts</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/04/memories-and-kharma/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Depth And Games</title>
		<link>http://www.sgtconker.com/2010/03/depth-and-games/</link>
		<comments>http://www.sgtconker.com/2010/03/depth-and-games/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 07:03:52 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[MVP Watch]]></category>
		<category><![CDATA[Andy Dunn]]></category>
		<category><![CDATA[Chad Carter]]></category>
		<category><![CDATA[Charles Humphrey]]></category>
		<category><![CDATA[Chris G. Williams]]></category>
		<category><![CDATA[George W. Clingerman]]></category>
		<category><![CDATA[Glenn Wilson]]></category>
		<category><![CDATA[Iñaki Ayucar]]></category>
		<category><![CDATA[Joel Martinez]]></category>
		<category><![CDATA[John Sedlak]]></category>
		<category><![CDATA[Jon Watte]]></category>
		<category><![CDATA[Matt Pettino]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/03/depth-and-games/</guid>
		<description><![CDATA[Matt “Blitzkrieg” Pettino fights with the depth buffer and Charles “One” Humphrey flags bits in XNA.
Meanwhile, George W. “The Frayed Ends of Sanity” Clingerman stares at walls, not goats and Chris G. “Fade to Black” Williams says Good Night.
Glenn “Welcome Home (Sanitarium)” Wilson installs the Windows Phone Developer Tools CTP finally, Jon “Escape” Watte releases [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mynameismjp.wordpress.com/">Matt “Blitzkrieg” Pettino</a> <a title="For fun and precision!" href="http://mynameismjp.wordpress.com/2010/03/22/attack-of-the-depth-buffer/">fights with the depth buffer</a> and <a href="http://xna-uk.net/blogs/randomchaos/">Charles “One” Humphrey</a> <a title="Technically it is C#, but well…" href="http://xna-uk.net/blogs/randomchaos/archive/2010/03/24/bit-flags-in-xna.aspx">flags bits in XNA</a>.</p>
<p>Meanwhile, <a href="http://www.xnadevelopment.com/">George W. “The Frayed Ends of Sanity” Clingerman</a> <a title="He&#39;s Batman!" href="http://twitter.com/clingermangw/statuses/11006279926">stares at walls, not goats</a> and <a href="http://twitter.com/chrisgwilliams/">Chris G. “Fade to Black” Williams</a> <a title="…and Good Luck." href="http://twitter.com/chrisgwilliams/statuses/11023860310">says Good Night</a>.</p>
<p><a href="http://www.virtualrealm.com.au/">Glenn “Welcome Home (Sanitarium)” Wilson</a> <a title="…and takes pictures of the process!" href="http://www.virtualrealm.com.au/blogs/installing-the-windows-phone-developer-tools-ctp/">installs the Windows Phone Developer Tools CTP finally</a>, <a href="http://www.enchantedage.com/">Jon “Escape” Watte</a> <a title="Fixes two reported bugs!" href="http://twitter.com/jwatte/statuses/11020778763">releases a beta of kW X-port 1.4.5 for 3DS Max 2010</a> and in a desperate move <a href="http://thezbuffer.com/">Andy “Harvester of Sorrow” Dunn</a> <a title="He&#39;s the Optimistic MVP now :)" href="http://forums.xna.com/forums/p/50052/303144.aspx#303144">begs for common sense to be applied during peer review</a>. Following the lead of desperation, <a href="http://graphicdna.blogspot.com/">Iñaki “Whiplash” Ayucar</a> <a title="To duplicate is to lose." href="http://graphicdna.blogspot.com/2010/03/you-duplicating-you-wrong.html">fulminates against clones, strongly</a>.</p>
<p><a href="http://jsedlak.org/">John “Motorbreath” Sedlak</a> <a title="MVP Fashion" href="http://twitter.com/jsedlak/statuses/11043855917">has a new jacket</a>, <a title="Labeled!" href="http://twitpic.com/1auh24">with a back</a>, <a title="I still remembering playing the first one…" href="http://jsedlak.org/2010/03/25/running-settlers-7-in-windowed-mode/">plays games</a>, <a title="In LINQ and Lambdas" href="http://twitter.com/jsedlak/status/11067793612">writes cryptic code</a>. <a href="http://codecube.net/">Joel “Ride the Lightning” Martinez</a> <a title="Don&#39;t we all?" href="http://twitter.com/joelmartinez/status/11039511252">loves LINQ</a> and <a title="After G.O.D. follows G.O.M.?" href="http://twitter.com/joelmartinez/status/11046594144">threats to release a game</a>. Finally, <a href="http://xnaessentials.com/unleashed/">Chad “Hit the Lights” Carter</a> <a title="I never really understood why there need to be dedicated parent days (other than a pointless reason to drink lots of alcohol, semi accepted by society)" href="http://twitter.com/kewlniss/status/11118567522">is a happy daddy</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/depth-and-games/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

