<?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>Bjarni Thor &#187; Home</title>
	<atom:link href="http://bjarni.us/category/home/feed/" rel="self" type="application/rss+xml" />
	<link>http://bjarni.us</link>
	<description>A place that random tech ramblings can call home</description>
	<lastBuildDate>Tue, 26 Jul 2011 01:10:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Projects!</title>
		<link>http://bjarni.us/projects/</link>
		<comments>http://bjarni.us/projects/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 04:50:31 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=424</guid>
		<description><![CDATA[Added a new projects page for stuff that I can be bothered to release to the public! First up, OrangeRed; System tray reddit inbox checker :)]]></description>
			<content:encoded><![CDATA[<p>Added a new <a title="Projects" href="http://bjarni.us/projects/">projects </a>page for stuff that I can be bothered to release to the public!</p>
<p>First up, <a title="OrangeRed" href="http://bjarni.us/projects/orangered/">OrangeRed</a>; System tray <a href="http://www.reddit.com">reddit</a> inbox checker :)</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What to expect in a (game) programmer interview</title>
		<link>http://bjarni.us/what-to-expect-in-a-game-programmer-interview/</link>
		<comments>http://bjarni.us/what-to-expect-in-a-game-programmer-interview/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 23:54:06 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=388</guid>
		<description><![CDATA[I didn&#8217;t want to jinx it but I&#8217;ve been working full time at Gearbox Software as a graphics programmer since August :D I interviewed with a few game developers before ending up at Gearbox and I wanted to share my experience in a vain hope that someone might avoid getting burned in his first interview at [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t want to jinx it but I&#8217;ve been working full time at <a href="http://www.gearboxsoftware.com">Gearbox Software</a> as a graphics programmer since August :D I interviewed with a few game developers before ending up at Gearbox and I wanted to share my experience in a vain hope that someone might avoid getting burned in his first interview at his dream company or for a dream position. Thankfully my first real interview where I got burned was not for a job that I would have jumped at without hesitation, which gave me a heads up on how to prepare for the coming interviews.</p>
<p>In my very first full day on-site interview I had a 2 hour coding test in a closed room on a computer with no internet connection and nothing but Word installed. The test consisted of various challenging coding problems that I was expected to solve in C++, from algorithms to bit twiddling to physics. I finished before the time was up and had lunch with the HR rep while the programmers reviewed the test. I aced the test and was brought in for further interrogation. They started off talking about the test, why I did this this way, what are some other ways to solve this problem, can this be done faster, etc. After about an hour of that they brought in a new set of people that asked me technical questions related to the position I was interviewing for (I actually didn&#8217;t even know what position beforehand, they had contacted me and asked me to come) for about an hour. Questions were all over the place, ranging from performance to graphics to how emerging technology could be applied to existing products. The last set of people came in and asked me more HR related questions such as why I wanted to work there and all that routine stuff. The interview concluded and I got a brief tour of the company before taking off. In all phases of the interviews I was given the opportunity to ask them questions.</p>
<p><span id="more-388"></span></p>
<p>The next interview I had was very different. I had applied on the internet and was asked to do a timed coding test over email (4 or 6 hours I think). It was pretty challenging and consisted of similar stuff as the first one, bit twiddling (not explicitly stated, but ideal solution would use that), algorithms and game logic. I was however allowed to use any programming language I wanted, as the position was less C++ oriented. A few days after handing in the test I was asked for a phone interview which was about an hour long and was pretty basic, some technical questions (only specifics I remember was object orientation) but nothing really hard. Subsequently I was flown in for an on site interview, which would prove to be quite an eye opener. I showed up at 9am and after a brief talk to HR (who told me that I did really well on the test, and that 90% actually fail the initial test and don&#8217;t even get a phone interview) I was hauled into a meeting room with a couple of people. I was given an algorithmic problem to solve in C++ in notepad (computer was  hooked up to a projector) or a whiteboard. Let&#8217;s just say that for whatever reason(it would be a lame excuse to say that I woke up at 2am body clock time(but I wrote it here anyway?!)), I did not go about solving the problem correctly. It took me forever and a lot of hints, but I eventually got it. This was followed by another algorithmic problem that I failed equally bad at solving, although I made it in the end. This is how the entire day went. I was not asked a single question related to my experience or the position, it only consisted of these problem solving exercises. The problem I had with the questions was not that the solutions were particularly hard, it was just that I had pretty much never had anyone watch me code under insane pressure, which threw me completely off track.</p>
<p>If you don&#8217;t have experience coding on a whiteboard I&#8217;ll spare you the pain; <strong>GET <a href="http://www.amazon.com/Programming-Interviews-Exposed-Secrets-Programmer/dp/047012167X/ref=sr_1_1?ie=UTF8&amp;qid=1287963071&amp;sr=8-1">THIS BOOK</a> NOW</strong>. It&#8217;s not game programming specific but it doesn&#8217;t matter, all of the questions asked were generic. It&#8217;s not about learning solutions either, not by a longshot, but about practicing coding solutions for someone that is watching which is <strong>very</strong> different to what we (programmers as a whole) do on a daily basis. It&#8217;s also a great book to study during flights or waits in airports! I was never asked a question directly from the book in an interview so I didn&#8217;t get any &#8220;free passes&#8221; (nor was I expecting any) but it was the practice /thought process that mattered.</p>
<p>Armed with a few days worth of whiteboard solving practice, I embarked on my 2nd and last set of interviews, which I will outline in another post :)</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/what-to-expect-in-a-game-programmer-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imagine Cup US 2010 &#8211; Conclusions</title>
		<link>http://bjarni.us/imagine-cup-us-2010-conclusions/</link>
		<comments>http://bjarni.us/imagine-cup-us-2010-conclusions/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 22:41:17 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=384</guid>
		<description><![CDATA[Well, Imagine Cup is over and we didn&#8217;t win :( Here are a couple of videos from our entry (HD and fullscreen recommended!): Teaser: Gameplay Trailer:]]></description>
			<content:encoded><![CDATA[<p>Well, Imagine Cup is over and we didn&#8217;t win :(<br />
Here are a couple of videos from our entry (HD and fullscreen recommended!):</p>
<p>Teaser:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/S-wlzm0oSHA&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/S-wlzm0oSHA&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Gameplay Trailer:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/YmsGBOga1i8&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/YmsGBOga1i8&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/imagine-cup-us-2010-conclusions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imagine Cup US 2010</title>
		<link>http://bjarni.us/imagine-cup-us-2010/</link>
		<comments>http://bjarni.us/imagine-cup-us-2010/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:53:22 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=378</guid>
		<description><![CDATA[Just got back from the Imagine Cup US finals in DC, late last night. We didn&#8217;t win. In fact, we didn&#8217;t even get to the final 4 (out of 10 teams). When we first heard on Sunday, we were fine with it, thought we just didn&#8217;t have the quality, but after seeing the final 4 [...]]]></description>
			<content:encoded><![CDATA[<p>Just got back from the Imagine Cup US finals in DC, late last night.</p>
<p>We didn&#8217;t win. In fact, we didn&#8217;t even get to the final 4 (out of 10 teams). When we first heard on Sunday, we were fine with it, thought we just didn&#8217;t have the quality, but after seeing the final 4 presentation on Monday, we&#8217;re&#8230; confused.. to say the least. </p>
<p>Our presentation style was very different than the other teams (long demo, no smooth-talking bullshit vs 1-2 min game demo (if that) and all smooth-talking bullshit), but we&#8217;re hoping that that wasn&#8217;t the cause.</p>
<p>We&#8217;re supposed to find out why today or tomorrow. </p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/imagine-cup-us-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ray to Ellipsoid Intersection</title>
		<link>http://bjarni.us/ray-to-ellipsoid-intersection/</link>
		<comments>http://bjarni.us/ray-to-ellipsoid-intersection/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 03:17:33 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=368</guid>
		<description><![CDATA[Took me a while to find a proper/working algorithm for Ray to Ellipsoid intersection that gave me the distance back, so I figured I&#8217;d repost it here, perhaps Google will rate it highly! :) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [...]]]></description>
			<content:encoded><![CDATA[<p>Took me a while to find a proper/working algorithm for Ray to Ellipsoid intersection that gave me the distance back, so I figured I&#8217;d repost it here, perhaps Google will rate it highly! :)</p>

<div class="wp_codebox"><table><tr id="p3682"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code" id="p368code2"><pre class="cs" style="font-family:monospace;">public static float? RayToEllipsoid(ref Ray ray, ref BoundingEllipsoid ellipsoid)
{
    // Source: http://www.ogre3d.org/forums/viewtopic.php?f=2&amp;t=26442&amp;start=0
&nbsp;
    Ray transformedRay = ray;
    transformedRay.Position -= ellipsoid.Center;
    transformedRay.Direction.Normalize();
&nbsp;
    float a = ((transformedRay.Direction.X * transformedRay.Direction.X) / (ellipsoid.Radius.X * ellipsoid.Radius.X))
            + ((transformedRay.Direction.Y * transformedRay.Direction.Y) / (ellipsoid.Radius.Y * ellipsoid.Radius.Y))
            + ((transformedRay.Direction.Z * transformedRay.Direction.Z) / (ellipsoid.Radius.Z * ellipsoid.Radius.Z));
&nbsp;
    float b = ((2 * transformedRay.Position.X * transformedRay.Direction.X) / (ellipsoid.Radius.X * ellipsoid.Radius.X))
            + ((2 * transformedRay.Position.Y * transformedRay.Direction.Y) / (ellipsoid.Radius.Y * ellipsoid.Radius.Y))
            + ((2 * transformedRay.Position.Z * transformedRay.Direction.Z) / (ellipsoid.Radius.Z * ellipsoid.Radius.Z));
&nbsp;
    float c = ((transformedRay.Position.X * transformedRay.Position.X) / (ellipsoid.Radius.X * ellipsoid.Radius.X))
            + ((transformedRay.Position.Y * transformedRay.Position.Y) / (ellipsoid.Radius.Y * ellipsoid.Radius.Y))
            + ((transformedRay.Position.Z * transformedRay.Position.Z) / (ellipsoid.Radius.Z * ellipsoid.Radius.Z))
            - 1;
&nbsp;
    float d = ((b * b) - (4.0f * a * c));
&nbsp;
    if (d &lt; 0)
    {
        return null;
    }
    else
    {
        d = (float)Math.Sqrt(d);
    }
&nbsp;
    float hit = (-b + d) / (2.0f * a);
    float hitsecond = (-b - d) / (2.0f * a);
&nbsp;
    if (hit &lt; hitsecond)
    {
        return hit;
    }
    else
    {
        return hitsecond;
    }
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/ray-to-ellipsoid-intersection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nvidia NvPerfHud and XNA / C#</title>
		<link>http://bjarni.us/nvidia-nvperfhud-and-xna-c/</link>
		<comments>http://bjarni.us/nvidia-nvperfhud-and-xna-c/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 01:49:47 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[NvPerfHud]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=354</guid>
		<description><![CDATA[Just wanted to post this here in hopes that Google will pick it up and help others that might encounter the same problem since I found absolutely nothing about this on the INTERTUBES. NvPerfHud crashes horribly every time we try to run it with our game through it. The crashes make little sense, as it [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to post this here in hopes that Google will pick it up and help others that might encounter the same problem since I found absolutely nothing about this on the INTERTUBES.</p>
<p>NvPerfHud crashes horribly every time we try to run it with our game through it. The crashes make little sense, as it is not our executable that is crashing, but csc.exe (C# command line compiler) as well as some other stuff like the windows error reporting mechanism. Other XNA applications work fine however so I knew it had to be something specific to our game. After hours of debugging and talking to some Nvidia guys on their <a href="http://developer.nvidia.com/forums/index.php?showtopic=4127">forums</a>, I managed to find out that it was XML deserialization that was causing the culprit. Apparently when C# deserializes an XML file (that we use for settings and particle systems) it creates temporary code in your temporary folder and compiles it to a dll that it then loads to deserialize the XML.</p>
<p>I do however not have a solution for this (yet), we just disabled the component that was loading the XML. This would probably be fixable by precompiling the XML serialization routines, which is possible with some tools (such as <a href="http://msdn.microsoft.com/en-us/library/bk3w6240%28VS.80%29.aspx ">Sgen</a>), but they did not work for me due to some weird namespace conflicts, which were a documented limitation of the tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/nvidia-nvperfhud-and-xna-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Semester wrap up</title>
		<link>http://bjarni.us/semester-wrap-up/</link>
		<comments>http://bjarni.us/semester-wrap-up/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 21:13:16 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cosmopolis]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=315</guid>
		<description><![CDATA[2 cold spells, 1 imagine cup and 1 demo day later, this semester is over, the Christmas break has arrived and a quick wrap up is in order. Cosmopolis was selected as a finalist for the US Imagine Cup which will be held in Washington DC sometime late April. We&#8217;ll get shipped up there for [...]]]></description>
			<content:encoded><![CDATA[<p>2 cold spells, 1 imagine cup and 1 demo day later, this semester is over, the Christmas break has arrived and a quick wrap up is in order.</p>
<p>Cosmopolis was selected as a finalist for the US Imagine Cup which will be held in Washington DC sometime late April. We&#8217;ll get shipped up there for a weekend of who-knows-what. With some luck and a lot of hard work, we&#8217;ll hopefully break into the international finals in Poland later that year.</p>
<p>Demo Day* was a huge success an enormous failure at the same time. Huge failure because I somehow managed to book my flight back to Iceland in the morning meaning that I&#8217;d miss the entire Demo Day, something I did not realize until 2 days before. I need a personal assistant to book my flights in the future. The Cosmopolis demo however was a huge success from what I&#8217;ve heard, the best one there by most people&#8217;s accounts. Just wish I had been there.</p>
<p>*Demo Day  is a dedicated day at the end of the semester where people from the game industry come to USC and watch students present the best projects of the semester for almost an entire day.</p>
<p>With that in mind, here is what matters, the videos presented at Demo Day. Keep in mind that these are probably unnecessarily  long, intended for someone to be talking while they are playing. Maybe we&#8217;ll put up annotations sometime. The videos are in HD, so fullscreen + HD is recommended.</p>
<p>What I specifically worked on in this is pretty much the programming of everything you see (and don&#8217;t see, ie core engine stuff) except the animation system. I wrote all the shaders and pretty much everything graphics related (vegetation, terrain, water, time of day, shadows, particle system, etc), as well as a big part of the gameplay (including network) for both (sub)games.</p>
<p><strong><br />
Cosmopolis: United Nations Millennium Challenge.</strong><br />
This game (or subgame actually) was our Imagine Cup submission, although the graphics have been improved a little bit since our original submission. The premise here is that you play as a United Nations officer trying to build up a war torn nation. The specific gameplay that we implemented was de-mining. You have a mine detector and a map at your disposal and take a part of a collaberative and persistent de-mining efftort, where individual score is kept track of. The mine detector is sound based and and once you have locked down the position of the mine you throw rocks at it to blow it up.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/cNrXce3bdmM&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/cNrXce3bdmM&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong><br />
Cosmopolis: WarPipe.</strong><br />
This subgame is compltely different from UNMC and is meant to be used for research purposes in the near future. Right now the gameplay is pretty much just a free for all killfest involving an assault rifle and 3 types of grenades (smoke, flashbang and frag). Teamplay is the #1 thing to add in the next semester.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/P8KV0cVTAok&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/P8KV0cVTAok&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong><br />
Cosmopolis: World Tools</strong><br />
This is just a demo of the tools we used to create the Cosmopolis world.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/cQH3hyx7BBc&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/cQH3hyx7BBc&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/semester-wrap-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chris Metzen</title>
		<link>http://bjarni.us/chris-metzen/</link>
		<comments>http://bjarni.us/chris-metzen/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 06:39:31 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[Blizzard]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=309</guid>
		<description><![CDATA[Today&#8217;s Game Design class had a guest speaker, Chris Metzen. I had heard the name before but wasn&#8217;t really sure on any details, so I did some research. His wikipedia article is pretty conservative, basically stating that he is a long time Blizzard employee, so I wasn&#8217;t sure what, or who, to expect. I soon [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Thor"><img class="alignright" title="Thor" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Thor.jpg/260px-Thor.jpg" alt="" width="260" height="385" /></a>Today&#8217;s Game Design class had a guest speaker, Chris Metzen. I had heard the name before but wasn&#8217;t really sure on any details, so I did some research. His wikipedia article is pretty conservative, basically stating that he is a long time Blizzard employee, so I wasn&#8217;t sure what, or who, to expect.</p>
<p>I soon found out however, that I was standing (or sitting rather) face to face with the father of the Warcraft universe and the reason that Warcraft 2 (and presumably installment #3 and WoW too) was made. And he&#8217;s pretty damn cool too. He spoke (in a very entertaining ranting manner) about how Blizzard <em>just barely</em> managed to avoid bankruptcy and rise to be (in my opinion) the top game studio in the world today. He also described the &#8220;every voice counts&#8221; creative process at Blizzard. What stood out though was that no matter what he said, incredible passion and devotion shone through his words.</p>
<p>Not going to write up any details, aside from one. He really, really.. really really really likes Modern Warfare 2. I haven&#8217;t played through the campaign yet as I tend to get bored of single player stuff (although Spec Ops mode has been keeping me entertained) but just listening to him describing it gave me goosebumps. He literally said that MW2 has changed his vision and has forced him to rethink <em>everything</em>.</p>
<p>On that note&#8230; I&#8217;m off to a session of Modern Warfare 2.</p>
<p>Ps. He also said that my middle name (Thor) is epic. So that&#8217;s my name from now on.</p>
<p>Pps. Note to Chris, if you ever happen to google your name or something: Thanks for taking the time for this <strong>great</strong> lecture / QA session!</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/chris-metzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImagineCup deadline is in 13 hours!</title>
		<link>http://bjarni.us/imaginecup-deadline-is-in-13-hours/</link>
		<comments>http://bjarni.us/imaginecup-deadline-is-in-13-hours/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 19:16:55 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[Cosmopolis]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=295</guid>
		<description><![CDATA[Random screenshots are always fun! Another view of starting town. Another overview of starting town. Time of day system. Much improved vegetation. More dense and blends into the ground smoothly. Accurate shadows from alpha mapped polygons.]]></description>
			<content:encoded><![CDATA[<p>Random screenshots are always fun!</p>
<p style="text-align: center;"><a href="http://steik.org/dump/Cosmopolis2009-11-1600-33-02-49.png"><img class="aligncenter" title="http://steik.org/dump/Cosmopolis2009-11-1600-33-02-49.png" src="http://steik.org/dump/Cosmopolis2009-11-1600-33-02-49.png" alt="" width="484" height="288" /></a>Another view of starting town.</p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://steik.org/dump/Cosmopolis2009-11-1807-53-00-47.png"><img class="aligncenter" title="http://steik.org/dump/Cosmopolis2009-11-1807-53-00-47.png" src="http://steik.org/dump/Cosmopolis2009-11-1807-53-00-47.png" alt="" width="484" height="288" /></a>Another overview of starting town.</p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://steik.org/dump/Cosmopolis2009-11-1807-50-55-62.png"><img class="aligncenter" title="http://steik.org/dump/Cosmopolis2009-11-1807-50-55-62.png" src="http://steik.org/dump/Cosmopolis2009-11-1807-50-55-62.png" alt="" width="484" height="288" /></a>Time of day system.</p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://steik.org/dump/Cosmopolis2009-11-1415-23-40-03.jpg"><img class="aligncenter" title="http://steik.org/dump/Cosmopolis2009-11-1415-23-40-03.jpg" src="http://steik.org/dump/Cosmopolis2009-11-1415-23-40-03.jpg" alt="" width="484" height="288" /></a>Much improved vegetation. More dense and blends into the ground smoothly.</p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://steik.org/dump/Cosmopolis2009-11-1701-02-54-84.png"><img class="aligncenter" title="http://steik.org/dump/Cosmopolis2009-11-1701-02-54-84.png" src="http://steik.org/dump/Cosmopolis2009-11-1701-02-54-84.png" alt="" width="484" height="288" /></a>Accurate shadows from alpha mapped polygons.</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/imaginecup-deadline-is-in-13-hours/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Quest for Shadows</title>
		<link>http://bjarni.us/the-quest-for-shadows/</link>
		<comments>http://bjarni.us/the-quest-for-shadows/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 21:58:44 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[Cosmopolis]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=272</guid>
		<description><![CDATA[Cosmopolis has a very large dynamic world. Players can modify terrain and building placement at runtime, in addition to day/night cycles. This brings up a plethora of issues in regards to shading and shadowing. Most video games use precomputed global illumination lightmaps to make the lighting look great at the cost of a single texture [...]]]></description>
			<content:encoded><![CDATA[<p>Cosmopolis has a very large dynamic world. Players can modify terrain and building placement at runtime, in addition to day/night cycles. This brings up a plethora of issues in regards to shading and shadowing. Most video games use precomputed global illumination lightmaps to make the lighting look great at the cost of a single texture lookup. Unfortunately for us (well, fortunately for me as I enjoy attempting to solve this problem immensely) we must make things look pretty at runtime.</p>
<p>Starting with shadows, there are a number of issues that I have run into and I just wanted to prevent people from doing the same mistakes, so here are a few tips:</p>
<ul>
<li>All shadow tech demos/examples generally have a tiny scene to show off their shadowing technique.
<ul>
<li>Don&#8217;t be fooled into thinking that it could scale to fit your 8km view distance scene (or even 150m view distance).</li>
</ul>
</li>
</ul>
<ul>
<li>Most shadow tech demos/examples have a static/hardcoded positional light.
<ul>
<li>If you have a sunlight (directional with infinite position) you run into a new set of problems.
<ul>
<li>The light view matrix must be placed somewhere&#8230; How do you determine this point? CameraPosition + (-LightDirection * 10000) seems like a good idea, but if you do that you have no resolution in your depth map. CameraPosition + (-LightDirection * 100) seems like the obvious answer to that, but that creates a parallax effect as the camera moves.</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li>Screen Space Shadow Maps are an interesting idea, but blurring them is a terrible idea.
<ul>
<li>Viewed up close the &#8220;pixels&#8221; of your shadow map are way too big on your screen to be blurred together</li>
<li>Viewed far away the shadows will bleed into nearby objects that are not supposed to have shadow at all</li>
</ul>
</li>
</ul>
<p>With that in mind, I have mixed together PSSM (<a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html">Parallel Split Shadow Maps</a>) and SSSM (<a href="http://www.gamedev.net/reference/articles/article2193.asp">Screen Space Shadow Maps</a>) with acceptable results (for now). PSSM is used to position 3 &#8220;light cameras&#8221; based on the position and rotation of the player camera, each at a different distance. The first covering the immediate surroundings and last covering about 250m view distance. To avoid the hard shadow edges I render a screen space shadow maps using PCF (<a href="http://www.gametutorials.com/gtstore/pc-322-1-pcf-shadow-mapping-with-glsl.aspx">Percentage Close Filtering</a>) and then use the results of that map as an input to the objects that can receive shadows.</p>
<p>I render a depth map every other frame as opposed to rendering every depth map (remember there are 3) every frame. They are scaled to cover more than exactly the player&#8217;s view frustum to afford some leniency. I do however have to create the SSSM every frame, with a pretty expensive pixel shader, which is probably what I&#8217;ll try to tweak in the future.</p>
<p>Here are the results:</p>
<p style="text-align: center;"><a href="http://bjarni.us/wp-content/uploads/2009/10/Cosmopolis-2009-10-23-14-48-16-86.jpg"><img class="aligncenter size-large wp-image-284" title="Cosmopolis 2009-10-23 14-48-16-86" src="http://bjarni.us/wp-content/uploads/2009/10/Cosmopolis-2009-10-23-14-48-16-86-1024x640.jpg" alt="Cosmopolis 2009-10-23 14-48-16-86" width="491" height="307" /></a></p>
<p>And here you can see the 3 depth maps rendered on the screen (top) and the SSSM results in the middle-left:</p>
<p style="text-align: center;"><a href="http://bjarni.us/wp-content/uploads/2009/10/Cosmopolis-2009-10-23-14-49-16-62.jpg"><img class="aligncenter size-large wp-image-285" title="Cosmopolis 2009-10-23 14-49-16-62" src="http://bjarni.us/wp-content/uploads/2009/10/Cosmopolis-2009-10-23-14-49-16-62-1024x640.jpg" alt="Cosmopolis 2009-10-23 14-49-16-62" width="491" height="307" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/the-quest-for-shadows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

