<?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>Slyfox &#187; University</title>
	<atom:link href="http://slyfox.za.net/tag/university/feed/" rel="self" type="application/rss+xml" />
	<link>http://slyfox.za.net</link>
	<description>Concentrated awesome</description>
	<lastBuildDate>Sun, 30 Aug 2009 18:29:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Terra</title>
		<link>http://slyfox.za.net/2008/10/terra/</link>
		<comments>http://slyfox.za.net/2008/10/terra/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:11:58 +0000</pubDate>
		<dc:creator>slyfox</dc:creator>
				<category><![CDATA[University]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://slyfox.za.net/?p=14</guid>
		<description><![CDATA[One of the homework assignments for our Graphics course was to implement a terrain renderer using a quadtree structure. After reading up on it a bit, I attempted to implement the method described by Ulrich&#8217;s article (although I won&#8217;t lie: the working demo code given in the article helped a good deal with that part). [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_15" class="wp-caption aligncenter" style="width: 310px"><a href="http://slyfox.za.net/wp-content/uploads/2008/10/terra1.jpg" rel="shadowbox[post-14];player=img;"><img src="http://slyfox.za.net/wp-content/uploads/2008/10/terra1-300x233.jpg" alt="Terra: Full Heightfield" title="Terra" width="300" height="233" class="size-medium wp-image-15" /></a><p class="wp-caption-text">Terra: Full Heightfield</p></div>
<p>One of the homework assignments for our Graphics course was to implement a terrain renderer using a quadtree structure. After <a href="http://www.gamasutra.com/features/20000228/ulrich_01.htm">reading</a> up on it a bit, I attempted to implement the method described by Ulrich&#8217;s article (although I won&#8217;t lie: the working demo code given in the article helped a good deal with that part). The image above is the end result of the terrain renderer, along with the quaternion-based camera library I implemented for the previous assignment.</p>
<div id="attachment_16" class="wp-caption alignleft" style="width: 160px"><a href="http://slyfox.za.net/wp-content/uploads/2008/10/terra2.jpg" rel="shadowbox[post-14];player=img;"><img src="http://slyfox.za.net/wp-content/uploads/2008/10/terra2-150x150.jpg" alt="Terra: Wireframe Heightfield" title="Terra" width="150" height="150" class="size-thumbnail wp-image-16" /></a><p class="wp-caption-text">Terra: Wireframe Heightfield</p></div>
<p>The random terrain in this example was created by generating a 1024&#215;1024 image in GIMP using the Solid Noise filter and saving it as a PNG, which Terra uses to generate the heightmap. The image used to texture the terrain was created by applying a gradient map to the grayscale heightmap, and adding an embossed version of the grayscale heightmap on top of the gradient mapped heightmap to give the illusion of a directional light source.</p>
<p>The inset image is the same scene as the first image in this post, but rendered in wireframe mode. If one looks closely, one can see how the adaptive quadtree algorithm uses more triangles for high-detail parts of the heightmap, and less (&#8221;bigger&#8221;) triangles for less detailed parts.</p>
<p>Finally, the last image below is also the same scene as the other two images, but with a detail factor 2¼ times higher than the first two images, also rendered in wireframe, highlighting the increased number of triangles.</p>
<div id="attachment_17" class="wp-caption aligncenter" style="width: 310px"><a href="http://slyfox.za.net/wp-content/uploads/2008/10/terra3.jpg" rel="shadowbox[post-14];player=img;"><img src="http://slyfox.za.net/wp-content/uploads/2008/10/terra3-300x233.jpg" alt="Terra: High Detail Heightfield" title="Terra" width="300" height="233" class="size-medium wp-image-17" /></a><p class="wp-caption-text">Terra: High Detail Heightfield</p></div>
]]></content:encoded>
			<wfw:commentRss>http://slyfox.za.net/2008/10/terra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun Time At The Zoo</title>
		<link>http://slyfox.za.net/2008/10/fun-time-at-the-zoo/</link>
		<comments>http://slyfox.za.net/2008/10/fun-time-at-the-zoo/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 21:54:13 +0000</pubDate>
		<dc:creator>slyfox</dc:creator>
				<category><![CDATA[University]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://slyfox.za.net/?p=5</guid>
		<description><![CDATA[I finally managed to finish my implementation of a deadlock detector for my year project (a C framework with which to develop distributed model checking applications) earlier today. While writing the code to output resource usage statistics, I noticed that I&#8217;d forgotten all along to add optimisation flags to my make files.
Running the detector with [...]]]></description>
			<content:encoded><![CDATA[<p>I finally managed to finish my implementation of a <a href="http://en.wikipedia.org/wiki/Deadlock">deadlock</a> detector for my year project (a C framework with which to develop distributed <a href="http://en.wikipedia.org/wiki/Model_checking">model checking</a> applications) earlier today. While writing the code to output resource usage statistics, I noticed that I&#8217;d forgotten all along to add optimisation flags to my make files.</p>
<p>Running the detector with the <kbd>-O2</kbd> optimisation flags yielded the following statistics:</p>
<pre><code>pcronje@gecko modelchecker $ mpirun -H localhost ./deadlock -q -q
[0] Resource usage statistics:
 * Store memory (bytes) : 192000
 * User time   (work)   : 2.568160
 * User time   (total)  : 2.652165
 * System time (total)  : 0.008000
 * Page faults/reclaims : 0/1461</code></pre>
<p>Switching over to <kbd>-O3</kbd> yielded:</p>
<pre><code>pcronje@gecko modelchecker $ mpirun -H localhost ./deadlock -q -q
[0] Resource usage statistics:
 * Store memory (bytes) : 192000
 * User time   (work)   : 1.520095
 * User time   (total)  : 1.604100
 * System time (total)  : 0.016001
 * Page faults/reclaims : 0/1463</code></pre>
<p>Not bad. Force of habit running a Gentoo system makes me go <kbd>-O2</kbd> by default when optimising.</p>
<p>Interestingly enough, running the deadlock detector across two systems yielded the following statistics (the number in square brackets indicate the process ID of the printing process):</p>
<pre><code>pcronje@gecko modelchecker $ mpirun -H localhost,localhost ./deadlock -q -q
[1] Resource usage statistics:
 * Store memory (bytes) : 96000
 * User time   (work)   : 0.872055
 * User time   (total)  : 0.948059
 * System time (total)  : 0.028001
 * Page faults/reclaims : 3/1628
[0] Resource usage statistics:
 * Store memory (bytes) : 96000
 * User time   (work)   : 0.880055
 * User time   (total)  : 0.972060
 * System time (total)  : 0.008000
 * Page faults/reclaims : 7/1623</code></pre>
<p>Obviously, the memory usage is neatly halved (since that&#8217;s just how the state generator I&#8217;m using to test this sucker works), but the interesting thing is the decrease in runtime. I would&#8217;ve thought that the communications overhead involved in throwing work items around between processes would&#8217;ve made the whole thing about as fast as swimming in tar. I guess the smaller memory footprint is making the difference when the analyser reads through the work item store or something. It&#8217;s something I&#8217;ll look at once I start properly evaluating the project.</p>
]]></content:encoded>
			<wfw:commentRss>http://slyfox.za.net/2008/10/fun-time-at-the-zoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
