<?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 Arnason</title>
	<atom:link href="http://bjarni.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://bjarni.us</link>
	<description>A place that random tech ramblings can call home</description>
	<lastBuildDate>Mon, 22 Feb 2010 03:17:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public static float? RayToEllipsoid(ref Ray ray, ref BoundingEllipsoid ellipsoid)
{
    // Source: http://www.ogre3d.org/forums/viewtopic.php?f=2&#38;t=26442&#38;start=0
&#160;
    Ray transformedRay = ray;
 [...]]]></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>0</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 is [...]]]></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 a [...]]]></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 found [...]]]></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>0</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>
		<item>
		<title>Point sprite scaling in XNA</title>
		<link>http://bjarni.us/point-sprite-scaling-in-xna/</link>
		<comments>http://bjarni.us/point-sprite-scaling-in-xna/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 10:19:20 +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=264</guid>
		<description><![CDATA[Today, to my horror, I realized after creating a point-sprite based particle system for Cosmopolis that XNA does not seem to support point-sprite scaling. Meaning that if you set your point sprite to be of size 100, it will occupy 100 pixels on your screen whether you are viewing it up close, or miles away. [...]]]></description>
			<content:encoded><![CDATA[<p>Today, to my horror, I realized after creating a point-sprite based particle system for Cosmopolis that XNA does not seem to support point-sprite scaling. Meaning that if you set your point sprite to be of size 100, it will occupy 100 pixels on your screen whether you are viewing it up close, or miles away. After a decent session of googling I <a href="http://graphicdna.blogspot.com/2009/09/properly-scaling-point-sprites-in.html">found a solution</a> which involves setting renderstates that the XNA does not allow you to set in code. You instead need to set them in the HLSL shader pass definition (which I normally do not like to do for various reasons). This will suffice (and set up a &#8220;correct&#8221; scale according to the previously linked article):</p>

<div class="wp_codebox"><table><tr id="p2644"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p264code4"><pre class="hlsl" style="font-family:monospace;">pass Pass0
{
      VertexShader = compile vs_1_1 VS_Particles();
      PixelShader = compile ps_1_1 PS_Particles();
&nbsp;
      POINTSCALEENABLE= TRUE;
      POINTSCALE_A = 0.0f;
      POINTSCALE_B = 0.0f;
      POINTSCALE_C = 1.0f;
      POINTSIZE_MIN = 0.0f;
      POINTSIZE_MAX = 9999.0f;
}</pre></td></tr></table></div>

<p>Just be aware that you can not set these renderstates back through XNA, although it shouldn&#8217;t affect anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/point-sprite-scaling-in-xna/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cosmopolis Introduction</title>
		<link>http://bjarni.us/cosmopolis-introduction/</link>
		<comments>http://bjarni.us/cosmopolis-introduction/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 10:09:02 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[Cosmopolis]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=259</guid>
		<description><![CDATA[The project I&#8217;m working on right now (and our submission to the Imagine Cup) is called Cosmopolis, previously known as Codename Life or Warpipe. In short, it&#8217;s a testbed for behavioral model research, funded by the Department of Defense, engineered at USC GamePipe with some design inputs from CMU. I could copy and paste a [...]]]></description>
			<content:encoded><![CDATA[<p>The project I&#8217;m working on right now (and our submission to the Imagine Cup) is called <a href="http://gamepipe.usc.edu/USC_GamePipe_Laboratory/R%26D/Entries/2009/10/5_The_USC_GamePipe_Laboratorys_Cosmopolis_Online_Game_-_a_Behavioral_Model_Testbed.html">Cosmopolis</a>, previously known as Codename Life or Warpipe. In short, it&#8217;s a testbed for behavioral model research, funded by the Department of Defense, engineered at <a href="http://gamepipe.usc.edu/">USC GamePipe</a> with some design inputs from <a href="http://www.cmu.edu/">CMU</a>. I could copy and paste a whole bunch of academic jargon about the idea and purpose, but as a proud non-PhD student I try not to get lost in the imaginary (they call it theory) world too much and just focus on programming and making things look pretty, at 60 FPS minimum.</p>
<p>My role is graphics and engine programming. Our team is pretty small right now, so I&#8217;m responsible for most things rendered on the screen, except UI. Balki (AKA Balakrishnan Ranganathan, but no one knows that&#8217;s his real name), a PhD student at USC Gamepipe, is leading the project and works mostly on engine, server and whatever dirty work that needs to be done. Marc Spraragen is another PhD student on the project, taking care of most of our paper writing needs as well as some AI. Then we have Nitin Venugopal, working mainly on patcher and deployment things. Last but not least there is Aadarsh Patel who was heavily involved in the summer but drowned by coursework at the moment. He wrote the animation system and content pipeline for the models.</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/cosmopolis-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imagine Cup Challenge!</title>
		<link>http://bjarni.us/imagine-cup-challenge/</link>
		<comments>http://bjarni.us/imagine-cup-challenge/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 17:45:33 +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=253</guid>
		<description><![CDATA[As a part of entering the Imagine Cup competition and getting a free PDC ticket to boot (worth ~$1600), I have been challenged to start writing some random blurbs about my Imagine Cup development experience as well as my experience at PDC.
So&#8230; yeah! Our team at USC are making a game called Cosmopolis. The gameplay [...]]]></description>
			<content:encoded><![CDATA[<p>As a part of entering the <a href="http://imaginecup.us">Imagine Cup</a> competition and getting a free <a href="http://microsoftpdc.com/">PDC</a> ticket to boot (worth ~$1600), I have been challenged to start writing some random blurbs about my Imagine Cup development experience as well as my experience at PDC.</p>
<p>So&#8230; yeah! Our team at <a href="http://www.usc.edu">USC</a> are making a game called Cosmopolis. The gameplay will not be discussed but I&#8217;ll try to share some random technical details, both from the past and as they are implemented. Subjects could include for example: Ambient Occlusion, Parallel Split Shadow Maps, 3D Particle Systems, Terrain visualization and Nvidia Nexus experiences.</p>
<p>However, chances are that I will fail miserably like 95% of other &#8220;blo**&#8221; (I despite that word), so come back often to laugh in my face when I don&#8217;t post anything! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/imagine-cup-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Little Bundle of Joy</title>
		<link>http://bjarni.us/home/</link>
		<comments>http://bjarni.us/home/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 03:30:38 +0000</pubDate>
		<dc:creator>Bjarni Arnason</dc:creator>
				<category><![CDATA[Home]]></category>

		<guid isPermaLink="false">http://bjarni.us/?p=3</guid>
		<description><![CDATA[Hey!
My name is Bjarni Thor Arnason and I&#8217;m a (or at least aspire to be) Game Programmer. I&#8217;m not looking for a job right now (working for Mythic Entertainment as a Software Engineering Intern on Warhammer Online), but I like to keep track of my work because we all know it can be a pain [...]]]></description>
			<content:encoded><![CDATA[<p>Hey!</p>
<p>My name is Bjarni <a href="http://en.wikipedia.org/wiki/Thor">Thor</a> Arnason and I&#8217;m a (or at least aspire to be) Game Programmer. I&#8217;m not looking for a job right now (working for <a href="http://www.mythicentertainment.com/">Mythic Entertainment</a> as a Software Engineering Intern on<a href="http://warhammeronline.com/"> Warhammer Online</a>), but I like to keep track of my work because we all know it can be a pain to get that old project running 2 years down the road when you want to show it to someone.</p>
<p>I&#8217;m less than a year away from graduating from <a href="http://www.usc.edu/">USC </a>with a Master&#8217;s degree in <a href="http://gamepipe.usc.edu">Computer Science &#8211; Game Development</a>, so I&#8217;ll probably get more active in job searching when that moment draws close. But by then I&#8217;ll also probably edit this text :)</p>
<p>Thanks for stopping by! If you are curious about any of my projects, feel free to send me an <a href="http://bjarni.us/contact">email</a>. Even if you are a student, not just recruiters!</p>
]]></content:encoded>
			<wfw:commentRss>http://bjarni.us/home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
