<?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>Terry Butler &#187; Programming</title>
	<atom:link href="http://www.terrybutler.co.uk/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.terrybutler.co.uk</link>
	<description>Personal Homepage of Terry Butler</description>
	<lastBuildDate>Thu, 29 Jul 2010 03:44:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Darken Javascript Bookmarklet Update</title>
		<link>http://www.terrybutler.co.uk/2010/07/21/darken-javascript-bookmarklet-update/</link>
		<comments>http://www.terrybutler.co.uk/2010/07/21/darken-javascript-bookmarklet-update/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 23:13:37 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/2010/07/21/darken-update/</guid>
		<description><![CDATA[This is just a simple modification of the Javascript bookmarklet called &#8220;Darken&#8221; by Gina Trapani. No idea if it had already been updated or not, but here&#8217;s the list of what I changed for anybody interested: Running the bookmarklet multiple times toggles the darken effect on and off! Saves refreshing the page Changed the colour [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a simple modification of the Javascript bookmarklet called &#8220;Darken&#8221; by Gina Trapani. No idea if it had already been updated or not, but here&#8217;s the list of what I changed for anybody interested:
<ul>
<li>Running the bookmarklet multiple times toggles the darken effect on and off! Saves refreshing the page</li>
<li>Changed the colour scheme to green text</li>
<li>Added hover effect for links</li>
<li>Changed link colour and added underline to differentiate links</li>
<li>Changed link visited colour</li>
<li>Only uses the appendChild method as that&#8217;s all the Browsers I use support (Opera, IE9, Firefox, Chrome)</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">javascript<span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #003366; font-weight: bold;">var</span> newSS<span style="color: #339933;">,</span> styles <span style="color: #339933;">=</span> <span style="color: #3366CC;">'* { background-color: black ! important; color: green !important; }a:link, a:link * { color: green !important; text-style: underline; }a:visited, a:visited * { color: #7f0000 !important; }a:hover, a:hover * { color: red !important; }'</span><span style="color: #339933;">;</span>var elemHead <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>var elemCSS <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;darkenCSS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>if <span style="color: #009900;">&#40;</span>elemCSS<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>elemHead.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>elemCSS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>newSS <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>newSS.<span style="color: #660066;">rel</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'stylesheet'</span><span style="color: #339933;">;</span>newSS.<span style="color: #660066;">href</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'data:text/css,'</span> <span style="color: #339933;">+</span> escape<span style="color: #009900;">&#40;</span>styles<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>newSS.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;darkenCSS&quot;</span><span style="color: #339933;">;</span>elemHead.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newSS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2010/07/21/darken-javascript-bookmarklet-update/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ray Tracing #5</title>
		<link>http://www.terrybutler.co.uk/2009/12/12/ray-tracing-5/</link>
		<comments>http://www.terrybutler.co.uk/2009/12/12/ray-tracing-5/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 18:06:28 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Compute Shaders]]></category>
		<category><![CDATA[DirectX 11]]></category>
		<category><![CDATA[Ray Tracing]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/2009/12/12/ray-tracing-5/</guid>
		<description><![CDATA[Things have been a little slow recently. I’ve been generally reading about other aspects of graphics programming as well as generally being busy and now I’ve come down with something. Blocked ear, runny nose, bad headaches, dizziness and more. My best excuse for not getting as much programming done has to be that I’ve given [...]]]></description>
			<content:encoded><![CDATA[<p align="left">Things have been a little slow recently. I’ve been generally reading about other aspects of graphics programming as well as generally being busy and now I’ve come down with something. Blocked ear, runny nose, bad headaches, dizziness and more. </p>
<p align="left">My best excuse for not getting as much programming done has to be that I’ve given coffee a bit of a hiatus for a while just to get some of the benefits of caffeine back. Good for the health though! … <img src='http://www.terrybutler.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p align="left">I’ve still managed to get the majority of the ray tracer working in a DirectX 11 Compute Shader (working on DirectX 10 hardware using CS_4_0), although I have some small issues that I can’t track down before I can release a screenshot that looks identical to what I already have put up, albeit at 100 times better performance <img src='http://www.terrybutler.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p align="left">Unfortunately there are no recursive functions allowed in the Compute Shaders, which means that I’m going to need to rethink stuff like the reflection traces and whatnot.</p>
<p align="left">DirectX 11 (and DirectX in general) is still weird to work with, but slowly, things are coming together. </p>
<p align="left">On a side note, I spent some of today looking at the Quake source and thinking about how cool a DirectX 11 port might be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/12/12/ray-tracing-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ray Casting #2</title>
		<link>http://www.terrybutler.co.uk/2009/11/29/ray-casting-2/</link>
		<comments>http://www.terrybutler.co.uk/2009/11/29/ray-casting-2/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 15:39:24 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Ray Casting]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/?p=180</guid>
		<description><![CDATA[Finally got around to adding those few lines of code to add textured walls to the ray caster. (Click to Show Full Size) (Click to Show Full Size) A few details: 1) The texture isn&#8217;t mine, I merely found it via Google Images with the term &#8220;wall texture&#8221; and it has the filename &#8220;Wall_Texture_by_shadowh3.JPG&#8221; 2) [...]]]></description>
			<content:encoded><![CDATA[<p>Finally got around to adding those few lines of code to add textured walls to the ray caster.</p>
<p><a href="http://www.terrybutler.co.uk/downloads/raycasting/RC%202009-11-29%2015-14-57-82.png"><img src="http://www.terrybutler.co.uk/downloads/raycasting/RC%202009-11-29%2015-14-57-82%20(Small).png" alt="" /></a><br />
(Click to Show Full Size)</p>
<p><a href="http://www.terrybutler.co.uk/downloads/raycasting/RC%202009-11-29%2015-15-22-26.png"><img src="http://www.terrybutler.co.uk/downloads/raycasting/RC%202009-11-29%2015-15-22-26%20(Small).png" alt="" /></a><br />
(Click to Show Full Size)</p>
<p>A few details:</p>
<p>1) The texture isn&#8217;t mine, I merely found it via Google Images with the term &#8220;wall texture&#8221; and it has the filename &#8220;Wall_Texture_by_shadowh3.JPG&#8221;<br />
2) There&#8217;s still a problem with the corners of the grids having a weird fringe. It&#8217;s better than it was, but still not right. Haven&#8217;t tracked that down yet, but have some ideas<br />
3) The somewhat hybrid mix (Courtesy of XNA) of performing the ray casting algorithm and then using the hardware to render (i.e. the column strips as Lines, plus using the hardware to render the correct strip of texture, which is all nice and filtered) is arguably making using the ray caster seem futile. Depends on how you look at that one I suppose. I think it&#8217;s neat<br />
4) A bit of &#8220;FYI&#8221;. John Carmack&#8217;s <a href="http://www.idsoftware.com/wolfenstein-3d-classic-platinum/wolfdevelopment.htm">article </a> on how he wrote the iPhone version of Wolfenstein 3D is what really got me wanting to do this. Many thanks to him for the unrelenting inspiration!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/11/29/ray-casting-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ray Tracing #4</title>
		<link>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-4/</link>
		<comments>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-4/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 20:57:53 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/?p=165</guid>
		<description><![CDATA[Two updates in one day. This is probably a first on my blog Here&#8217;s an image of a single reflective sphere in the middle of three other spheres of various colours with lighting and shadows: Here&#8217;s a quick look at all of the spheres featuring reflectivity and how they look when recursively casting off one [...]]]></description>
			<content:encoded><![CDATA[<p>Two updates in one day. This is probably a first on my blog <img src='http://www.terrybutler.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s an image of a single reflective sphere in the middle of three other spheres of various colours with lighting and shadows:</p>
<p><img src="http://www.terrybutler.co.uk/downloads/raytracing/RayTracing%202009-11-22%2020-44-19-56.png" alt="Ray Tracing #4 - Three spheres with lighting and shadows being reflected by a single central reflective sphere in the middle of the scene" /></p>
<p>Here&#8217;s a quick look at all of the spheres featuring reflectivity and how they look when recursively casting off one and another:</p>
<p><img src="http://www.terrybutler.co.uk/downloads/raytracing/RayTracing%202009-11-22%2020-50-26-31.png" alt="Ray Tracing #4 - Four reflective spheres with lighting, shadows and reflections" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ray Tracing #3</title>
		<link>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-3/</link>
		<comments>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-3/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 16:39:01 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/2009/11/22/ray-tracing-3/</guid>
		<description><![CDATA[Just a little more to add. I have shadows working but there&#8217;s a bug or two in there that I can&#8217;t seem to shift, but here&#8217;s what I&#8217;ve got anyway:]]></description>
			<content:encoded><![CDATA[<p>Just a little more to add. I have shadows working but there&#8217;s a bug or two in there that I can&#8217;t seem to shift, but here&#8217;s what I&#8217;ve got anyway:</p>
<p><img alt="" src="http://www.terrybutler.co.uk/downloads/raytracing/RayTracing%202009-11-22%2016-32-05-87.png" title="Ray Tracing #3 - Three Spheres with two lights and shadowing" class="alignnone" width="512" height="512" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/11/22/ray-tracing-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ray Tracing #2</title>
		<link>http://www.terrybutler.co.uk/2009/11/20/ray-tracing-2/</link>
		<comments>http://www.terrybutler.co.uk/2009/11/20/ray-tracing-2/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 14:50:38 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/?p=162</guid>
		<description><![CDATA[Here&#8217;s what I have so far: Of course, it&#8217;s still very much some ways off the high quality rendering that ray tracing can be known for, but it&#8217;s a good learning experience all the same.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what I have so far:</p>
<p><img src="http://www.terrybutler.co.uk/downloads/raytracing/RayTracing%202009-11-20%2014-10-35-68.png" alt="Ray Tracing Update #2 - Two Planes and a Sphere being lit" /></p>
<p>Of course, it&#8217;s still very much some ways off the high quality rendering that ray tracing can be known for, but it&#8217;s a good learning experience all the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/11/20/ray-tracing-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ray Casting and Ray Tracing</title>
		<link>http://www.terrybutler.co.uk/2009/11/17/ray-casting-and-ray-tracing/</link>
		<comments>http://www.terrybutler.co.uk/2009/11/17/ray-casting-and-ray-tracing/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:28:14 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/?p=154</guid>
		<description><![CDATA[Having spent a lot of time on rasterizer based rendering, I&#8217;ve wanted to learn more about ray tracing, if only for the sake of curiosity. I also wanted to revisit ray casting, as it had been some time and I took some of the finer details for granted the first time around, so this time, [...]]]></description>
			<content:encoded><![CDATA[<p>Having spent a lot of time on rasterizer based rendering, I&#8217;ve wanted to learn more about ray tracing, if only for the sake of curiosity. I also wanted to revisit ray casting, as it had been some time and I took some of the finer details for granted the first time around, so this time, I went through it with a fine toothcomb to make sure I got all of the details down.</p>
<p>Given that the majority of speed is lost in blitting the columns to the screen in traditional ray casters, I decided to render each vertical strip as line primitives in XNA. It&#8217;s not a shabby use of the hardware, although I&#8217;d love to take a crack at writing a shader based ray caster sometime down the road. </p>
<p>I gave a quick performance test, although nothing too extensive but I did run it at 2048&#215;1152 (amongst other oversized resolutions) and it managed to fulfil the synced 60fps, which was nice to see.</p>
<p>Here&#8217;s a look at the basic ray caster in XNA:</p>
<p><img src="http://www.terrybutler.co.uk/downloads/raycasting/RC%202009-11-14%2013-11-51-53%20(Small).png" alt="Very simple ray caster in XNA" /></p>
<p>As for the ray tracing, I&#8217;ve not made too much progress and for the moment, I&#8217;m just performing intersections with a plane. I hear it only gets harder from there <img src='http://www.terrybutler.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Another detail; given that I&#8217;m working with a plane extending in just the X and Z directions (Facing +Y), I&#8217;m also hacking this slightly for test purposes due to the fact that I&#8217;m clamping its size at 64 units in the X (-32 to 32), and 64 units in the Z (-32 to 32) in order to give the plane some shape.</p>
<p>And also a look at the basic ray tracer in XNA:</p>
<p><img src="http://www.terrybutler.co.uk/downloads/raytracing/RayTracing%202009-11-17%2011-08-57-11%20%28Small%29.png" alt="Very simple ray traced plane" /></p>
<p>Again, I&#8217;m using XNA and except this time, I&#8217;m doing something a little different to the ray caster and I&#8217;m modifying the content of a texture and just drawing that texture to the screen with a SpriteBatch. I never said I was after performance.. At least not just yet anyway!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/11/17/ray-casting-and-ray-tracing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA Progress Post #1 – Lighting</title>
		<link>http://www.terrybutler.co.uk/2009/06/27/xna-progress-post-1-%e2%80%93-lighting/</link>
		<comments>http://www.terrybutler.co.uk/2009/06/27/xna-progress-post-1-%e2%80%93-lighting/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 18:10:59 +0000</pubDate>
		<dc:creator>Terry</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.terrybutler.co.uk/?p=28</guid>
		<description><![CDATA[At the moment, I’m still concentrating on transitioning to XNA, C# and HLSL, while revising some of the stuff I’ve done previously in OpenGL, but things are going okay in all. So far, I’ve got a working prototype for a deferred shading setup with normal mapping: Deferred Shading with Normal Mapping I also have basic [...]]]></description>
			<content:encoded><![CDATA[<p>At the moment, I’m still concentrating on transitioning to XNA, C# and HLSL, while revising some of the stuff I’ve done previously in OpenGL, but things are going okay in all.</p>
<p>So far, I’ve got a working prototype for a deferred shading setup with normal mapping:</p>
<div id="attachment_64" class="wp-caption aligncenter" style="width: 310px;"><a href="http://www.terrybutler.co.uk/wp-content/uploads/2009/06/dsnm.png"><img class="size-medium wp-image-64" title="Deferred Shading with Normal Mapping" src="http://www.terrybutler.co.uk/wp-content/uploads/2009/06/dsnm-300x225.png" alt="Deferred Shading with Normal Mapping" width="300" height="225" /></a></p>
<p class="wp-caption-text">Deferred Shading with Normal Mapping</p>
</div>
<p>I also have basic shadow mapping, but I still am yet to include it in the deferred shader. However, here’s what the basic forward lighting shader looks like at the moment:</p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 310px;"><a href="http://www.terrybutler.co.uk/wp-content/uploads/2009/06/basicshadowmapping.png"><img class="size-medium wp-image-63" title="Basic Shadow Mapping" src="http://www.terrybutler.co.uk/wp-content/uploads/2009/06/basicshadowmapping-300x225.png" alt="Basic Shadow Mapping" width="300" height="225" /></a></p>
<p class="wp-caption-text">Basic Shadow Mapping</p>
</div>
<p>This functionality will soon be imported into <a href="http://lisvane.homelinux.com/wordpress/?p=42">KnightEdit</a> and the lights will be very easy to place, making for rich, well lit scenes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terrybutler.co.uk/2009/06/27/xna-progress-post-1-%e2%80%93-lighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
