<?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>A Party to the World &#187; ray tracing</title>
	<atom:link href="http://dan.lecocq.us/wordpress/tag/ray-tracing/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.lecocq.us/wordpress</link>
	<description>Life, love, and computer science</description>
	<lastBuildDate>Sun, 25 Jul 2010 16:20:14 +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>Stanford Dragon and Gouraud Shading</title>
		<link>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:57:38 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[gouraud shading]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[octtrees]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=540</guid>
		<description><![CDATA[I recently finished up school, and part of that was finishing up my ray tracing project. At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface. What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated [...]]]></description>
			<content:encoded><![CDATA[<p>I recently finished up school, and part of that was finishing up my ray tracing project.  At the last minute, I implemented Gouraud shading which is a technique to try to smooth out a triangulated surface.  What it really does is just linearly interpolate the normal vectors, where the normal of a vertex is calculated as a weighted average of the normals of the triangles using that vertex.</p>
<p>Long story short:<br />
<div id="attachment_542" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny1.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny1-300x300.png" alt="A render of the Stanford bunny with my raytracer without Gouraud shading." title="bunny_flat" width="300" height="300" class="size-medium wp-image-542" /></a><p class="wp-caption-text">A render of the Stanford bunny with my raytracer without Gouraud shading.</p></div></p>
<div id="attachment_543" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunnysmooth.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunnysmooth-300x300.png" alt="A render of the Stanford bunny with smooth Gouraud shading." title="bunnysmooth" width="300" height="300" class="size-medium wp-image-543" /></a><p class="wp-caption-text">A render of the Stanford bunny with smooth Gouraud shading.</p></div>
<p>Also, thanks to an improvement in my parallelization of the problem and a speedup in octtree traversal, I was able to render the Stanford dragon model (~1 million triangles):</p>
<div id="attachment_544" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/dragon.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/dragon-300x168.png" alt="The Stanford dragon model." title="dragon" width="300" height="168" class="size-medium wp-image-544" /></a><p class="wp-caption-text">The Stanford dragon model.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/05/12/stanford-dragon-and-gouraud-shading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stanford Bunny</title>
		<link>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/#comments</comments>
		<pubDate>Mon, 04 May 2009 06:16:52 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[models]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[scan]]></category>
		<category><![CDATA[stanford bunny]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=534</guid>
		<description><![CDATA[The Stanford Bunny is a graphics benchmark of sorts. It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on. It contains a little under 70,000 triangles which makes brute-force ray tracing intractable. I mentioned octtrees earlier, and so having [...]]]></description>
			<content:encoded><![CDATA[<p>The Stanford Bunny is a graphics benchmark of sorts.  It was a high-resolution scan that the imaging lab there did of a ceramic bunny, and the triangulation is a popular model to test systems on.</p>
<p>It contains a little under 70,000 triangles which makes brute-force ray tracing intractable.  I mentioned octtrees earlier, and so having built octtrees into my ray tracer, I was able to render the Stanford Bunny in about 40 minutes on one core.  Granted, that&#8217;s with only 1-pass anti-aliasing, but I feel pretty good about this.  I don&#8217;t think I&#8217;ll have a chance to implement Gouraud shading (or normal interpolation for that matter), but as soon as I do, it will look a lot less blocky.</p>
<div id="attachment_535" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/05/bunny-300x168.png" alt="The Stanford Bunny rendered with my ray tracer." title="bunny" width="300" height="168" class="size-medium wp-image-535" /></a><p class="wp-caption-text">The Stanford Bunny rendered with my ray tracer.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/05/03/stanford-bunny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Octtrees For Space Rasterization</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 21:49:09 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computational geometry]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[octtree]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=525</guid>
		<description><![CDATA[Raytracing is slow. Incredibly slow. Painfully slow. That&#8217;s because you&#8217;ve got to check a lot of things to accurately determine what you&#8217;re seeing, if it&#8217;s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is. Enter octtrees. We&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Raytracing is slow.  Incredibly slow.  <em>Painfully</em> slow.  That&#8217;s because you&#8217;ve got to check a lot of things to accurately determine what you&#8217;re seeing, if it&#8217;s in shadow, if it reflects off of something, etc., so it helps quite a bit to be able to get an idea beforehand of where everything is.  Enter octtrees.</p>
<p>We&#8217;ve got a picture of a model (in this case, the Stanford bunny model).  It consists of thousands of tiny triangles that make a surface.  Then, imagine a cube surrounding the entire model.  If there are two many triangles in that cube, you cut the cube in to eight smaller cubes, and repeat.  What this build is a tree where &#8220;busy&#8221; portions of the space get divided more.</p>
<p>And now for pretty pictures:<br />
<div id="attachment_526" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunny.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunny-300x291.png" alt="The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea." title="bunny" width="300" height="291" class="size-medium wp-image-526" /></a><p class="wp-caption-text">The bunny on its own.  There are tricks to smooth it out, but I left it highly triangulated to better represent the idea.</p></div><br />
<div id="attachment_527" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytree.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytree-300x291.png" alt="Bunny with balanced wireframe octtree around it." title="bunnytree" width="300" height="291" class="size-medium wp-image-527" /></a><p class="wp-caption-text">Bunny with balanced wireframe octtree around it.</p></div><br />
<div id="attachment_528" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytreeside.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/bunnytreeside-300x291.png" alt="Profile of the bunny with a very deep octtree." title="bunnytreeside" width="300" height="291" class="size-medium wp-image-528" /></a><p class="wp-caption-text">Profile of the bunny with a very deep octtree.</p></div></p>
<p>I&#8217;m finishing up the implementation, and then I&#8217;ll be using it as part of my octtree as a intersection speedup.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/30/octtrees-for-space-rasterization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Orbits</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/30/orbits/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/30/orbits/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 21:29:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planets]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=523</guid>
		<description><![CDATA[Orbiting planets. The days are about twice as along as they normally are relative to each planet&#8217;s year, but that&#8217;s an aesthetic preference. Enjoy.]]></description>
			<content:encoded><![CDATA[<p>Orbiting planets.  The days are about twice as along as they normally are relative to each planet&#8217;s year, but that&#8217;s an aesthetic preference.  Enjoy.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/w3F_1HiCYs8&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/w3F_1HiCYs8&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/30/orbits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Render</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/26/new-render/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/26/new-render/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 04:56:54 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[clips]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[planets]]></category>
		<category><![CDATA[ray tracer]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[texturing]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=508</guid>
		<description><![CDATA[I got a new render up from my ray tracer that applies planetary textures to spheres and makes them spin on their respective axes (none of the planets in our solar system spin on a &#8220;vertical&#8221; axis). I hope to do one with their orbits, but I haven&#8217;t had a chance to get to it; [...]]]></description>
			<content:encoded><![CDATA[<p>I got a new render up from my ray tracer that applies planetary textures to spheres and makes them spin on their respective axes (none of the planets in our solar system spin on a &#8220;vertical&#8221; axis).  I hope to do one with their orbits, but I haven&#8217;t had a chance to get to it; though, the nice thing is, I just have to define their paths and rotations as a function of time, and where I want the viewpoint to be.  It took about 15 minutes to render in full HD 1080&#215;1920 on 18 processors:</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/z56qL2bHqNo&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/z56qL2bHqNo&#038;hl=en&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/26/new-render/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parallel Ray Tracer</title>
		<link>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/</link>
		<comments>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 21:54:05 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[parallel]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[raytracer]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/?p=480</guid>
		<description><![CDATA[This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines. Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections. It took only 1 minute and 20 seconds. For [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I was able to successfully parallelize the ray tracer I wrote for Graphics II to run on the Alamode cluster at Mines.  Using 17 machines, I was able to render a 4,096 x 4,096 pixel image with 25 passes and up to 5 reflections.  It took only 1 minute and 20 seconds.<br />
<div id="attachment_481" class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output.png"><img src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output-300x300.png" alt="Reflective spheres rendered at high resolution on a small cluster." title="Spheres" width="300" height="300" class="size-medium wp-image-481" /></a><p class="wp-caption-text">Reflective spheres rendered at high resolution on a small cluster.</p></div><br />
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output1.png"><img alt="Another image rendered on the same cluster" src="http://dan.lecocq.us/wordpress/wp-content/uploads/2009/04/output8-300x300.png" title="Sphere and Triangles" width="300" height="300" /></a><p class="wp-caption-text">Another image rendered on the same cluster</p></div></p>
<p>For the benefit of those who are not computer scientists, this is what the input file looks like:<br />
<code><br />
8192 8192<br />
0 0 20<br />
-1 -1 1<br />
2 0 0<br />
0 2 0<br />
3 10 10 0.8<br />
0.2<br />
9<br />
# These next few lines will define a triangle<br />
T<br />
# With one of the points at (1, 1, 1)<br />
1 1 1<br />
# and the next point here:<br />
0.12321 0.12321 -1<br />
# and the last point here:<br />
-1 1 1<br />
# and with this color setting<br />
1 1 1 1 1 1 0 1 0.7<br />
T<br />
-1 1 1<br />
-0.12321 0.12321 -1<br />
0.12321 0.12321 -1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
1 -1 1<br />
0.12321 -0.12321 -1<br />
-1 -1 1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
-1 -1 1<br />
-0.12321 -0.12321 -1<br />
0.12321 -0.12321 -1<br />
1 1 1 1 1 1 0 1 0<br />
T<br />
1 1 1<br />
0.12321 0.12321 -1<br />
1 -1 1<br />
1 0 0 1 0 0 0 1 0<br />
T<br />
1 -1 1<br />
0.12321 -0.12321 -1<br />
0.12321 0.12321 -1<br />
1 0 0 1 0 0 0 1 0<br />
T<br />
-1 1 1<br />
-0.12321 0.12321 -1<br />
-1 -1 1<br />
1 1 0 1 1 0 0 1 0<br />
T<br />
-1 -1 1<br />
-0.12321 -0.12321 -1<br />
-0.12321 0.12321 -1<br />
1 1 0 1 1 0 0 1 0<br />
S<br />
0 0 0 0.5<br />
1 0 1 1 0 1 0 1 0.3<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2009/04/04/parallel-ray-tracer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
