<?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>Friendly patterns and algorithms &#187; maths</title>
	<atom:link href="http://www.palgorithm.co.uk/tag/maths/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.palgorithm.co.uk</link>
	<description>Discussion of algorithms for games, graphics and general engineering</description>
	<lastBuildDate>Mon, 31 May 2010 11:21:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Maths and ShaderX8</title>
		<link>http://www.palgorithm.co.uk/2009/04/maths-and-shaderx8/</link>
		<comments>http://www.palgorithm.co.uk/2009/04/maths-and-shaderx8/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 12:15:18 +0000</pubDate>
		<dc:creator>Sam Martin</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[maths]]></category>
		<category><![CDATA[shaderx]]></category>

		<guid isPermaLink="false">http://www.palgorithm.co.uk/?p=172</guid>
		<description><![CDATA[ShaderX7 is out
ShaderX7 has now hit the press in the USA, although (at the time of writing) it looks like the UK will have to wait a bit longer. I was luck enough to nab a copy directly from the publisher while at GDC. The first thing you notice is it&#8217;s really fat this time [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ShaderX7 is out</strong></p>
<p><img style="float: left; margin-top: 10px; margin-bottom: 10px; margin-right: 10px;" class="size-full wp-image-159 alignnone" title="ShaderX7 Cover Art" src="http://www.palgorithm.co.uk/wp-content/uploads/2009/04/shaderx7_cvrart_small.jpg" alt="ShaderX7 Cover Art" width="100" height="122" /><a href="http://www.shaderx7.com/index.html">ShaderX7</a> has now hit the press in the <a href="http://www.amazon.com/ShaderX7-Rendering-Techniques-Wolfgang-Engel/dp/1584505982">USA</a>, although (at the time of writing) it looks like the <a href="http://www.amazon.co.uk/ShaderX7-Rendering-Techniques-Wolfgang-Engel/dp/1584505982">UK</a> will have to wait a bit longer. I was luck enough to nab a copy directly from the publisher while at <a href="http://www.gdconf.com/">GDC</a>. The first thing you notice is it&#8217;s <em>really</em> fat this time &#8211; definitely one of the largest books on my shelf. It&#8217;s not short on material and Amazon are currently selling it for<span class="priceLarge"> a bargain      $37.79</span><span class="priceLarge"> &#8211; rather short of the </span>$59.99 RRP. Go grab yourself a copy.</p>
<p>Editing the shadows section was my first adventure into the world of publishing, and I&#8217;m glad I put in the effort. I was genuinely&nbsp; surprised by the amount of time involved in editing just 4 articles, so my hat goes off to everyone &#8211; authors and editors alike &#8211; that contribute to these industry-led books. It&#8217;s not done for money, it&#8217;s very definitely a labour of love, and I&#8217;m happy that the end result made the work worthwhile.</p>
<p><strong>ShaderX8 &#8211; now with added maths</strong></p>
<p>Which leads me onto <a href="http://www.shaderx8.com/index.html">ShaderX8</a>! This time around there will be a new section on <strong>Mathematics</strong>, which Wolfgang is kindly allowing me to get my editing paws on. The idea here is that the complexity and quantity of maths involved in writing <a href="http://en.wikipedia.org/wiki/Shader">shaders</a> has greatly increased in recent times. Early shader models had pretty limited capabilities and most uses of them likely capped out at requiring knowledge of linear algebra &#8211; say, vectors, homogeneous matrices, and so on.&nbsp; But we are now fast approaching being able to run <a href="http://en.wikipedia.org/wiki/Larrabee_%28GPU%29">typical x86 code on a GPU</a> and the mathematical models being run are getting correspondingly more complex. There&#8217;s also more than one way of boiling your mathematical eggs, and performance matters. Part of the process in writing shaders is learning, developing and optimising mathematical models &#8211; hence the dedicated new section.</p>
<p>The book is still at proposal stage so what this section really needs now are some <strong>article proposals</strong>. Please take a look at the schedule on the<a href="http://www.shaderx8.com/"> ShaderX</a> website and <a href="email://wolf@shaderx.com">email your proposals to Wolfgang</a> before <strong>17th May 09</strong>. If you have any questions on the maths section feel free to <a href="email://sam@palgorithm.co.uk">email me</a> as well. The writing guidelines can be found <a href="http://www.shaderx6.com/ShaderX6.zip">here</a>.</p>
<p><strong>Complexity of maths in shaders</strong></p>
<p>Here&#8217;s my 2p on the complexity of maths in modern shaders. </p>
<p>I expect almost all graphics programmers will now at least have heard of <a href="http://en.wikipedia.org/wiki/Spherical_harmonics">spherical harmonics</a> as they are an extremely efficient way of capturing lighting irradiance. Given their importance, there have been several <a href="http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.pdf">excellent</a> <a href="http://home.comcast.net/%7Etom_forsyth/papers/SH_GDCE_TomF.zip">tutorials</a> written to help the games industry understand how they work. But my impression of the industry is that many people&#8217;s understanding of them is not yet at &#8220;comfortable&#8221; level. The use of spherical harmonics in graphics does not require comprehensive knowledge of the maths that underpins them, but it&#8217;s definitely a step up from what was required of a programmer in a younger industry.</p>
<p>To add some context, it&#8217;s worth noting that the use of spherical harmonics in lighting is now several years old. By industry standards spherical harmonics are by no means a new thing. I&#8217;d hazard this is evidence of their mathematical complexity reaching beyond what the industry is truly comfortable with handling. </p>
<p>Spherical harmonics are definitely not the most complex mathematical model in graphics. To use a more recent example: In the ShaderX7 Shadows section there&#8217;s a really excellent paper by <a href="http://www.cs.ucf.edu/%7Ecolbert/">Mark Colbert</a> and <a href="http://www.graphics.cornell.edu/%7Ejaroslav/">Jaroslav Křivánek</a>, <a href="http://www.mcl.ucf.edu/shaderx7/">&#8220;Real-time dynamic shadows for image-based lighting&#8221;</a>. I won&#8217;t go into the implementation details here, but suffice to say it&#8217;s non-trivial. It requires familiarity with some fairly advanced linear algebra, a very sound knowledge of sampling, and solving some fiddly least-squares problems with some interesting regularisation to prevent overfitting. It&#8217;s not dissimilar to the level of complexity of your typical SIGGRAPH paper.</p>
<p><a href="http://www.mcl.ucf.edu/shaderx7/"><img src="http://www.palgorithm.co.uk/wp-content/uploads/2009/04/mark-relighting.png" alt="mark-relighting" title="mark-relighting" width="495" height="248" class="aligncenter size-full wp-image-181" /></a><br />
<br />It&#8217;s a pretty steep learning curve these days. </p>
<p>(Get your proposals in!)</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.palgorithm.co.uk/2009/04/maths-and-shaderx8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
