<?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>Chris Norton &#187; Featured</title>
	<atom:link href="http://www.chnorton.com.au/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chnorton.com.au</link>
	<description>A blog about software engineering, web development, education and my otaku interests.</description>
	<lastBuildDate>Tue, 07 Dec 2010 11:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Accordion Navigation</title>
		<link>http://www.chnorton.com.au/2008/06/14/accordion-navigation/</link>
		<comments>http://www.chnorton.com.au/2008/06/14/accordion-navigation/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 05:39:50 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/?p=229</guid>
		<description><![CDATA[Yesterday at work I spent far too much time working on getting an accordion vertical navigation working in a new Magento design. In the interest of public education, here&#8217;s a walkthrough of how I went about getting this to work. Basically what was required was a simple form of an accordion menu where only the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday at work I spent far too much time working on getting an accordion vertical navigation working in a new Magento design. In the interest of public education, here&#8217;s a walkthrough of how I went about getting this to work.</p>
<p><span id="more-229"></span>Basically what was required was a simple form of an accordion menu where only the top-level categories will be visible initially but clicking on one will open up a submenu showing its children. It will also set that category as the current one and display the content for it.</p>
<p>Getting the basics up and running was fairly easy but I kept running into problems when I attempted to smooth out the rough edges. I ran into the old problem of Magento being very poorly documented, so trying to find out what avenues I could pursue took far longer than it should have. I also ran into a definite bug where there exist several functions for retrieving the parent of a category but they don&#8217;t actually work. I believe this stems from the fact that the parent_id values for categories are not entered into the database in the first place. Odd, and it shows that Magento really does have plenty of jagged edges.</p>
<p>I started out with <a href="http://www.magentocommerce.com/boards/viewreply/17585/" rel="external nofollow">this post</a> on the Magento forums. That set up a vertical list of top-level categories but displays the rest of the menu in much the same manner as the horizontal one in the default Magento design &#8211; as a popup nested list. Not what I was looking for.</p>
<p>Because I only wanted the current category to show up I added in a condition to check whether or not a category was &#8220;active&#8221; before displaying its children. Doing this works but unfortunately I was using a call to <code>$this->getCurrentChildren()</code> to retrieve the children of the top-level active category. This works when you click on the top-level links &#8211; the children are displayed correctly on the loaded page &#8211; but <em>doesn&#8217;t</em> work  when you navigate to one of the child categories, since obviously they are then set to the current category and will have different children to the top-level category.</p>
<p>I then came up with the simple idea of calling <code>$_category->getParentCategory()</code> and getting the children of that. This is when I ran into the aforementioned bug with the parent categories (<a href="http://www.magentocommerce.com/bug-tracking/issue?issue=2173" rel="external nofollow">see bug #5182</a>) which meant it was impossible to use that way.</p>
<p>After thinking through (and trying out) a few crazy ideas like building my own tree of categories and querying it, or overriding the majority of the Magento catalog navigation classes, I eventually realised the answer was actually quite simple, at least for the two level system I required (I haven&#8217;t tried it for more levels). All I had to do was check if each top-level category was active and had children and, if so, display the children. This works since a parent category is still active if one of it&#8217;s children is active. (I assume this functionality was added to make it easier to set highlighting styles on these categories.)</p>
<p>Here&#8217;s my modified <i class="file">vert_nav.phtml</i> file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;vertical-nav-container box base-mini&quot;&gt;
	&lt;div class=&quot;vertical-nav&quot;&gt;
		&lt;div class=&quot;head&quot;&gt;
		&lt;h4&gt;&lt; ?php echo $this-&gt;__('Navigation') ?&gt;&lt;/h4&gt;
		&lt;/div&gt;
		&lt;ul id=&quot;nav_vert&quot;&gt;
		&lt; ?php foreach ($this-&gt;getStoreCategories() as $_category): ?&gt;
			&lt; ?php $open = $this-&gt;isCategoryActive($_category) &amp;&amp; $_category-&gt;hasChildren(); ?&gt;
			&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_category</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&lt; ?php if($open) { echo ' class=&quot;open&quot;'; } ?&gt;&gt;&lt; ?=$_category-&gt;getName();?&gt;&lt;/a&gt;
			&lt; ?php if ($open): ?&gt;
        		&lt;ul&gt;
				&lt; ?php foreach ($_category-&gt;getChildren() as $child): ?&gt;
					&lt; ?php $childCat = Mage::getModel('catalog/category')-&gt;load($child); ?&gt;
					&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCategoryUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$childCat</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;&lt; ?=$childCat-&gt;getName();?&gt;&lt;/a&gt;&lt;/li&gt;
				&lt; ?php endforeach; ?&gt;
				&lt;/ul&gt;
			&lt; ?php endif; ?&gt;
			&lt;/li&gt;
		&lt; ?php endforeach ?&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>Originally I also tried to use <code>$_category->getAllChildren()</code> as this sounded more like what I wanted but this returned nothing so I went with what I have above, which works. It would be nice if there was a method that directly returned the children as category objects, rather than having to load them as an extra step &#8211; if such a method exists I didn&#8217;t find it so let me know if it is in there!</p>
<p>Everything else is roughly the same as the other vertical navigation tutorial. You&#8217;ll need to tweak your <abbr title="cascading stylesheets">CSS</abbr> to achieve a nicer nesting effect. I used left margins to indent the child category links.</p>
<p>Here are some images from the final product:<br />

<a href='http://www.chnorton.com.au/2008/06/14/accordion-navigation/topmenu/' title='topmenu'><img width="150" height="150" src="http://www.chnorton.com.au/wp-content/uploads/2008/09/topmenu-150x150.gif" class="attachment-thumbnail" alt="topmenu" title="topmenu" /></a>
<a href='http://www.chnorton.com.au/2008/06/14/accordion-navigation/submenu-dvd/' title='submenu-dvd'><img width="150" height="150" src="http://www.chnorton.com.au/wp-content/uploads/2008/09/submenu-dvd-150x150.gif" class="attachment-thumbnail" alt="submenu-dvd" title="submenu-dvd" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2008/06/14/accordion-navigation/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Magento Australia Post shipping module</title>
		<link>http://www.chnorton.com.au/2008/03/06/magento-australia-post-shipping-module/</link>
		<comments>http://www.chnorton.com.au/2008/03/06/magento-australia-post-shipping-module/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 00:00:25 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[australia]]></category>
		<category><![CDATA[fontis]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/2008/03/06/magento-australia-post-shipping-module/</guid>
		<description><![CDATA[I have completed the first part of a new module for the open source ecommerce software Magento which aims to add in a bunch of additional functionality specific for Australia. You can find the module, along with installation instructions at the Fontis Magento project page. It actually took quite a while to create this, rather [...]]]></description>
			<content:encoded><![CDATA[<p>I have completed the first part of a new module for the open source ecommerce software <a href="http://www.magentocommerce.com/" rel="external nofollow">Magento</a> which aims to add in a bunch of additional functionality specific for Australia. You can find the module, along with installation instructions at <a href="http://www.fontis.com.au/magento">the Fontis Magento project page</a>.</p>
<p><span id="more-212"></span>It actually took quite a while to create this, rather simple, first part of the module. This was mostly due to my lack of understanding of the way Magento modules work as well as the Zend Framework upon which Magento is built. At first I only wanted Australia Post shipping (rather than the more ambitious &#8220;all Australian functionality&#8221;) and, after failing to create a working module based on <a href="http://www.magentocommerce.com/wiki/how-to/create-shipping-method-module" rel="external nofollow">the outdated tutorial</a>, I was able to get something working by simply adding in the module to the core distribution files, which I achieved by copying things from the existing shipping modules. Unfortunately this isn&#8217;t really viable as the module should be separated from the core to avoid conflicts on updates and the like. And it&#8217;s not good practice.</p>
<p>So, I then discovered that the shipping methods for the USA carriers (eg. DHL, UPS) were actually contained in a separate module in the core and this inspired me to want to create a similar module for Australia which could include various shipping carriers, payment gateways and <abbr title="Goods and Services Tax">GST</abbr>.</p>
<p>Attempting to extract out the Australia Post shipping didn&#8217;t go so well at first and took much trial-and-error and searching of the Magento forums before I managed to get something that actually worked. But work it now does and it should be useful for most cases where you&#8217;d want to use Australia Post as a shipping method. It supports all methods available for domestic and international shpping, allows you to set a handling fee and, naturally, uses the Australia Post DRC to work out cost and shipping time.</p>
<p>There are a few things left to do on Australia Post before I&#8217;m 100% happy with it: I&#8217;d like to add insurance options, give the admin the ability to restrict shipping to certain methods (although I can&#8217;t think of why you&#8217;d want to do this) and clean up the code a bit. I have also discovered a few things that I&#8217;d like to add to the module if Magento actually allows the ability to do so: for instance, giving the user information about the shipping time without having to place it in the method title would be very handy as it means the invoice remains free of superfluous information but the user can make informed decisions during the checkout process.</p>
<p>After this the next thing I want to get working is GST and, following <em>that</em>, move on to getting bank payment gateways running. It will be good when Magento hits version 1.0 and some more developer documentation hits the streets &#8211; I may even start writing some up myself based on my experience with this module.</p>
<p>I would very much like to hear back from others about how well the module works on their setup, as well as any feature suggestions for the Australia Post shipping or the Australia module in general.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2008/03/06/magento-australia-post-shipping-module/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>eGames &amp; Entertainment Expo 2007: Report</title>
		<link>http://www.chnorton.com.au/2007/11/18/egames-entertainment-expo-2007-report/</link>
		<comments>http://www.chnorton.com.au/2007/11/18/egames-entertainment-expo-2007-report/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 10:14:00 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[convention]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[madman]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/2007/11/18/egames-entertainment-expo-2007-report/</guid>
		<description><![CDATA[The eGames &#038; Entertainment Expo was, overall, an enjoyable convention that let me check out a bunch of new games without having to actually pay money for them!]]></description>
			<content:encoded><![CDATA[<p>This was the first games expo I&#8217;ve attended but I must say that it was largely what I would have expected: various game companies pushing their latest games and consoles (Sony and Nintendo doing the lion&#8217;s share), various tertiary education institutions pushing their games-related courses (sadly Melbourne Uni hasn&#8217;t caught on) and various vendors trying to sell you stuff. Still, overall it was quite enjoyable and great to be able to check out the latest games without having to, say, buy a PS3. Following are some of my highlights from the event and my general review.</p>
<p><span id="more-180"></span>As I mentioned before, Sony and Nintendo were doing most of the marketing &#8211; they each had large areas assigned to them and were showing off at least a dozen games each as well as their respective consoles and handhelds. Sony in particular went to great effort to put their games on large, 1080p HDTV screens to maximise the eye candy of the PS3. Nintendo, on the other hand, seemed content to let the games do the talking for them (<i>Super Mario Galaxy</i> had queues of people lining up to play). Microsoft had a huge inflated Master Chief helmet but they weren&#8217;t really showing off much in the way of games, only <i>Halo 3</i> and <i>Mass Effect</i> running on a couple small screens. One of the interesting things is that, because you have both consoles makers and games publishers at the same event, it&#8217;s sometimes confusing as to who is responsible for what. For instance, Yamaha had an area and were using a Wii to show off their surround sound systems but from a distance is almost looked like another Nintendo booth.</p>
<p>The games of the day for me were <i>Crysis</i>, <i>Heavenly Sword</i> and <i>Assassin&#8217;s Creed</i>. <i>Crysis</i> looks gorgeous but mostly the same in terms of gameplay (no surprise there). <i>Heavenly Sword</i> I had to describe to someone as an &#8220;ocular orgasm&#8221; because it <em>just looks that good</em>. The gameplay did look a bit tame but I think the visuals alone would justify a purchase if it cost about $75 (<a href="http://www.ebgames.com.au/PS3/product.cfm?ID=6292" rel="external nofollow">it doesn&#8217;t unfortunately</a>). <i>Assassin&#8217;s Creed</i> was, I think, the darling of the expo as I believe I saw it in three different places: running on both Xbox 360s and PS3s. I couldn&#8217;t really tell much of a difference between the two versions, but at one point it looked like the Xbox version didn&#8217;t have shadows turned on. Weird. The game seems to be similar, gameplay-wise, to Thief or Splinter Cell but the graphics are very &#8220;next-gen&#8221; and it actually manages to convey a living world, filled with people. Most parts of the game I saw had at least 20 people on screen at any one time in narrow city streets.</p>
<p><i>Super Mario Galaxy</i> had a lot of people excited about it and the crowd around the three TVs running it were larger than most. I&#8217;m still trying to work out how exactly it&#8217;s played as there seems to be an odd two-player setup where two people control a single Mario. It does look like great fun though and the playing area is huge and seemingly allows for complete non-linear exploration.</p>
<p>There were a few competitions set up with <i>Call of Duty 4</i>, <i>Unreal Tournament 3</i> and so on. Some even had commentators. I&#8217;m not really into those sort of multiplayer games so I watched for a few minutes and moved on.</p>
<p>The main stage had different events running throughout the weekend but I never ended up checking any out. It looked like the usual sort of stuff though: panels, presentations and competitions. I think there was even a cosplay competition on at one point &#8211; obviously an attempt to try and maximise the audience for the expo. Unsurprisingly, the cosplay competition had what I think was the most number of people watching it.</p>
<p>Speaking of all things anime, Madman Entertainment had a booth in the middle of the convention hall. I ended up spending an obscene amount of money updating my anime and manga collections. I worked it out and I ended up saving roughly $60 by buying the stuff there instead of online or in a store. From now on I should try to do all my shopping at conventions!</p>
<p>One of the highlights of the expo was seeing tons of people walking around in some shirts from the Swinburne gamers club. Basically the shirt was red, with a send up of the OFLC&#8217;s R18+ logo, instead having the text beside it: &#8220;This rating not suitable for mature adults.&#8221; This is an old issue but still one that I think baffles a lot of people &#8211; why does Australia not have an R rating for games? All the other ratings have been brought into line with the movie ratings but for some bizarre reason the OFLC has refused to allow 18+ games to be sold (legally) in Australia. A sea of bright red shirts was a welcome sign of passive protest.</p>
<p>Something that didn&#8217;t surprise me but I still found interesting was the presence of a toned down version of &#8220;booth babes&#8221;. Basically, half the booths there had at least one, but usually several, hot women dressed in revealing clothes (hot pants, low-cut tops) to draw attention. What I found hilarious was at one booth where a bunch of guys were sitting around ogling <i>Assassin&#8217;s Creed</i> running on a 102 inch Panasonic TV &#8211; the two girls wandering around weren&#8217;t even getting a glance! I must admit, I only looked once myself before turning back to the game. Since I&#8217;m sure some women will be reading this, rest assured that they also had (what I assume to be) hot guys wearing tight t-shirts. I can&#8217;t comment too much on this though as I wasn&#8217;t really paying attention to them. <img src='http://www.chnorton.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So overall, I think the event was a success. There were plenty of people there and everyone looked like they were having a blast (sometimes literally, in a virtual sense). I definitely had fun and came away with a ton of swag so I&#8217;m happy, even though I didn&#8217;t actually spend more than a few hours there on Friday and Saturday. Did any readers end up attending? I&#8217;d like to hear what other people thought about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2007/11/18/egames-entertainment-expo-2007-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deluge Web Interface</title>
		<link>http://www.chnorton.com.au/2007/09/30/deluge-web-interface/</link>
		<comments>http://www.chnorton.com.au/2007/09/30/deluge-web-interface/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 05:34:36 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[deluge]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[webui]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/2007/09/30/deluge-web-interface/</guid>
		<description><![CDATA[In my last post on Deluge I commented that one of the things the BitTorrent client was lacking was a web interface. That situation has been rectified by a recent plugin that provides WebUI capabilities. After taking a look at what is offered I can say that it looks very promising but isn&#8217;t quite at [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.chnorton.com.au/2007/09/11/deluge-055/">my last post on Deluge</a> I commented that one of the things the BitTorrent client was lacking was a web interface. That situation has been rectified by a <a href="http://deluge-torrent.org/2007/09/26/deluge-web-interface/" rel="external">recent plugin that provides WebUI capabilities</a>. After taking a look at what is offered I can say that it looks very promising but isn&#8217;t quite at a stage where you&#8217;d want to use it for anything but the most basic administration of your torrents.</p>
<p><span id="more-143"></span>So far, the supported features are: authentication with username/password, viewing of the queue, uploading new torrents (from a local file or a URL), auto-refresh and pausing/resuming downloading. This enough for basic administration but one rather essential feature that is missing is the ability to change the queue position of torrents, such as to move something up or down. There are also no settings available so it relies on you having the system set up beforehand and not wanting to change anything. </p>
<p>Another key problem with running WebUI on Deluge is that the program itself requires a full desktop to be running as it requires GTK+. This means that you can&#8217;t run it on a server that has been set up to run a minimal set of software daemons from the shell. There&#8217;s no real reason why a torrent program needs a graphical interface so maybe a &#8220;headless&#8221; mode will be enabled on Deluge in future versions.</p>
<p>One interesting design decision made is that images and stylesheets are in a different directory to the templates. From the sounds of the directory they&#8217;re in (<span class="filename">static</span>) the intention is to have the unchanging components served from a different directory which could theoretically be on a completely different server. This is good practice for high traffic sites and is a common way of optimising a web site but I have to wonder why it was employed here. I assume that a personal interface to your BitTorrent client would <em>not</em> qualify as a high traffic site and the templating system is extraordinarily handicapped by having stylesheets and images in a different directory that is not related to the template in any way.</p>
<p>I would like to take a look at the plugin further and see if some improvements can be made, such as allowing full AJAX operations. I think using AJAX refreshes would be particularly beneficial as full page refreshes are terribly wasteful in terms of bandwidth and not very nice from a usability point of view. Other improvements should just be a matter of changing the template &#8211; for example, making the layout fluid rather than fixed width.</p>
<p>The WebUI plugin for Deluge does look promising and could eventually replace Azureus as my BitTorrent client but there are some important problems that would need to be addressed first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2007/09/30/deluge-web-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rendering Games with Raytracing</title>
		<link>http://www.chnorton.com.au/2007/09/22/rendering-games-with-raytracing/</link>
		<comments>http://www.chnorton.com.au/2007/09/22/rendering-games-with-raytracing/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 18:36:45 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/2007/09/22/rendering-games-with-raytracing/</guid>
		<description><![CDATA[My short run down on my thoughts on real-time ray tracing and where it should be heading.]]></description>
			<content:encoded><![CDATA[<p>PC Perspective has an excellent article entitled <a href="http://www.pcper.com/article.php?aid=455" rel="external">Rendering Games with Raytracing Will Revolutionize Graphics</a> that goes through some of the progress made on real-time ray tracing engines and what the future might hold, at least according to Intel. If you don&#8217;t know what ray tracing is, <a href="http://en.wikipedia.org/wiki/Ray_tracing" rel="external nofollow">the Wikipedia has the dirt as usual</a>.</p>
<p><span id="more-128"></span>Ray tracing has always been interesting to me. For one thing it&#8217;s how &#8220;real&#8221; rendering works so whenever you render something in Maya or 3D Studio MAX you&#8217;re most likely seeing ray tracing at work. Ever since reading <a href="http://www.amazon.com/gp/product/1571690042?ie=UTF8&#038;tag=chrisnortonso-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1571690042"><i>Black Art of 3D Game Programming</i></a><img src="http://www.assoc-amazon.com/e/ir?t=chrisnortonso-20&#038;l=as2&#038;o=1&#038;a=1571690042" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> way back in my youth (nearly a decade ago now) I always wondered why ray tracing wasn&#8217;t being put into games. The answer was, of course, that the performance is terrible. From the sounds of the article this is slowly becoming a non-issue.</p>
<p>The other obvious question then is that, if ray tracing scales so well on multi-core processors, then wouldn&#8217;t dedicated hardware such as, I don&#8217;t know, a <strong><abbr title="Graphics Processing Unit">GPU</abbr></strong> allow for real-time rendering? Modern GPUs are essentially hugely parallel processing systems and it seems rendering billions of rays per second with dedicated hardware would be a lot faster and free up the CPU for doing more important things. I haven&#8217;t heard anything about AMD, NVIDIA or even Intel thinking about adding ray tracing to their GPUs. The closest thing I&#8217;ve heard is a thing called <a href="http://graphics.cs.uni-sb.de/SaarCOR/" rel="external">SaarCOR</a> which seems to be designed as an architecture for creating real-time ray tracing hardware. The latest news on the site is from 2005 though so I don&#8217;t have a lot of hope for them. Back in 2004 the following progress had been made:</p>
<blockquote><p>Video and images are rendered in realtime on the SaarCOR Prototype FPGA implementation running at 90 MHz.<br />
This small prototype with only one rendering pipeline achieves already realtime frame rates of 15 to 60 fps in 512&#215;384 and 32 bit colour depth and between 5 to 15 fps at 1024&#215;768 in our benchmark scenes as presented on this page. Thus the prototype with on 90 MHz already achieves the performance of the highly optimized OpenRT software ray tracer on a (virtual) Pentium-4 with 8 to 12 GHz!</p></blockquote>
<p><a href="http://graphics.cs.uni-sb.de/SaarCOR/DynRT/DynRT.html" rel="external">See here for more info.</a> What this tells me is that dedicated hardware really is capable, already, of performing real-time ray tracing. The aforementioned prototype had a single pipeline running at 90MHz but a modern GPU typically has at least 8 pipelines running at speeds around 500MHz, with high-end cards hitting 32 pipelines and around 700MHz. What kind of frame rates would be possible using that kind of hardware? Seeing as ray tracing seems to scale almost linearly with the number of CPU cores, I&#8217;d apply a similar reasoning here and say that speeds of 200 fps at 1024&#215;768 should be possible. If ray tracing scales well with the number of pixels as well, which is seems to do, then even larger displays with 1920&#215;1200 resolutions should run at good speeds (~60 fps).</p>
<p>Of course, this is all purely guesswork on my part but I don&#8217;t think I&#8217;m that far off on my estimates. So why don&#8217;t we have this hardware? I&#8217;d fathom the reason is simply that it&#8217;d be too expensive for the graphics chip makers to attempt to come up with a completely new architecture for ray tracing that <em>also</em> has to accommodate the existing rasterisation architectures and capabilities.</p>
<p>In terms of software, I think being able to use high performance ray tracing when building a graphics engine would be a dream come true. Suddenly things that require lots of tricks, techniques and black magic to achieve, such as shadows and reflections, are handled completely automatically by the ray tracing system. All you&#8217;d have to do is define the meshes and the materials to be placed upon them along with the lights and cameras (and action?) and almost everything else would be taken care of. Advanced effects would have to be programmed into the pipeline but I don&#8217;t see many of those being needed often as currently most games are just trying to achieve as much realism as possible in their graphics.</p>
<p>The PC Perspective article also has some information about how anti-aliasing and texture filtering can be efficiently achieved through ray tracing. Collision detection can also be done via ray tracing as the maths is essentially the same.</p>
<p>There is an existing project called <a href="http://en.wikipedia.org/wiki/OpenRT" rel="external nofollow">OpenRT</a> that aims to provide an API, similar to OpenGL, for interfacing with low-level ray tracing hardware and software which could be used by game developers. I&#8217;m a bit dubious about this though since they&#8217;re not really &#8220;open&#8221; in the sense of using open source software but that&#8217;s not really all that different from OpenGL. What we need is an open source implementation so that more people can start playing around with the API. <a href="http://liris.cnrs.fr/~bsegovia/yacort/" rel="external">One is already in progress</a> and we&#8217;ll have to wait and see how successful it becomes.</p>
<p>Overall, I&#8217;d say the future looks bright for the use of ray tracing in games but we need to start seeing real commitment from GPU makers to start implementing the functionality. Running on CPUs is alright in the short term for experimentation and development but it&#8217;s not very viable in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2007/09/22/rendering-games-with-raytracing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking WordPress Blogging Offline</title>
		<link>http://www.chnorton.com.au/2007/09/13/taking-wordpress-blogging-offline/</link>
		<comments>http://www.chnorton.com.au/2007/09/13/taking-wordpress-blogging-offline/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 01:53:45 +0000</pubDate>
		<dc:creator>Chris Norton</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.chnorton.com.au/2007/09/13/taking-wordpress-blogging-offline/</guid>
		<description><![CDATA[After my extremely annoying experience with a broken network connection last weekend that cost me about an hour of writing, I&#8217;ve been thinking about what could be done to make sure such a thing couldn&#8217;t happen again. I believe looking into offline access for WordPress may represent a viable solution. I think having offline access [...]]]></description>
			<content:encoded><![CDATA[<p>After my extremely annoying experience with a broken network connection last weekend that cost me about an hour of writing, I&#8217;ve been thinking about what could be done to make sure such a thing couldn&#8217;t happen again. I believe looking into offline access for WordPress may represent a viable solution.</p>
<p><span id="more-99"></span>I think having offline access to your blog&#8217;s post writing would be a great feature to have for blog authors. It means, for example, that you&#8217;d be able to take a laptop on holiday with you and know that you can at least <em>write</em> your blog posts when they&#8217;re in your head and you can upload them to your server when you have an internet connection.</p>
<p>It also means that you wouldn&#8217;t need to have WordPress connected to the internet to be able to save posts. This means that clicking save has no chance of losing your work since it is saved to a local database. Another side effect is that periodically saving the post can occur much more frequently since local access is much faster and lower latency than accessing a remote server.</p>
<p>The problem, naturally, is how to implement this new functionality.</p>
<p>I think that offline access to the entire blog administration area is going to be practically impossible. This is mostly because of WordPress&#8217;s extremely flexible plugin system which means no two blogs can never be assumed to contain the same features. In fact, most blogs would have quite a number of modifications to the admin area such as SEO optimisations for posts and pages, comment filters, related posts and so on. This is, of course, to say nothing of the options for all of those plugins, as well as the themes used for the blog. So, overall, I believe true offline functionality would need to be limited to the &#8220;write&#8221; pages and, even then, the functionality of the system would need to be limited to the bare essentials: title, post content, optional excerpt, categories, trackbacks, and the post options such as post slug, post status, etc. Other pages could still be shown from a cached version with &#8220;disabled in offline mode&#8221; in a lightbox or something.</p>
<p>So if we just want to enable offline post editing then a plugin needs to be created that loads the required offline access API (I thinking Google Gears) and all the client-side JavaScript to handle it. Presumably the plugin itself is not hard. The client-side logic would be more difficult. There is first the question of whether or not to allow &#8220;modal&#8221; or &#8220;modeless&#8221; offline access, which basically asks the question of whether or not to make offline &#8220;transparent&#8221; to the end user. If they lose their internet connection does everything keep working with reduced functionality (modeless) or do you require the user to switch into offline mode (modal)? To solve the initial problem I was discussing you would ideally want modeless access but then you have great problems reconciling the full functionality of the WordPress system when connected with the reduced functionality when there is no connection. For example, when connected you would naturally allow any and all plugins but what do you do when the connection is lost? The user will have had access to extra fields that the client-side code did not know about and so would not save. Hardly a great solution!</p>
<p>Some of my programmer intuition (is there such a thing?) tells me that there might be room for a devious system design that could read the code of the rendered writing page, pick out all the extra fields that are placed in there by plugins and add these dynamically to the local database store. This would effectively get around the reconciliation issue. I&#8217;m not how easy that would be to implement but my brief foray into jQuery makes me think it shouldn&#8217;t be that hard to detect &#8220;new&#8221; input fields.</p>
<p>There are still synchronisation issues but these are present in any web application wishing to provide offline functionality.</p>
<p>Overall, I&#8217;d say an offline WordPress system is definitely <em>possible</em> but how much work involved to get around some of the issue may be another matter entirely. I shall endeavour to look into the creation of a &#8220;WordPress Offline&#8221; plugin once I have time. <img src='http://www.chnorton.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chnorton.com.au/2007/09/13/taking-wordpress-blogging-offline/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

