<?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>The Witness</title>
	<atom:link href="http://the-witness.net/news/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://the-witness.net/news</link>
	<description>An exploration-puzzle game on an uninhabited island.  The development blog.</description>
	<lastBuildDate>Tue, 07 Sep 2010 02:35:43 +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>We showed The Witness secretly at PAX&#8230; in plain sight.</title>
		<link>http://the-witness.net/news/?p=471</link>
		<comments>http://the-witness.net/news/?p=471#comments</comments>
		<pubDate>Mon, 06 Sep 2010 18:40:43 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=471</guid>
		<description><![CDATA[Chris Hecker, the developer of SpyParty, and Andy Schatz, the developer of Monaco, have been writing about their preparations for a joint exhibit at PAX.  They were keeping a secret, though: there was a secret 3rd partner in the exhibit, and that was The Witness.
For all three days of PAX 2010, The Witness was publicly [...]]]></description>
			<content:encoded><![CDATA[<p>Chris Hecker, the developer of <a href="http://spyparty.com/" target="_blank">SpyParty</a>, and Andy Schatz, the developer of <a href="http://www.facebook.com/MonacoIsMine" target="_blank">Monaco</a>, have been writing about their <a href="http://www.gamasutra.com/view/feature/6032/monaco_and_spyparty_on_the_road_.php" target="_blank">preparations for a joint exhibit at PAX</a>.  They were keeping a secret, though: there was a secret 3rd partner in the exhibit, and that was <em>The Witness</em>.</p>
<p>For all three days of PAX 2010, <em>The Witness</em> was publicly playable by anyone who came by the booth.  However, it was unmarked and unattended, so it was easy to miss (as many people did; but then, plenty of people played it, too).</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/witness_table.png"><img class="aligncenter size-medium wp-image-475" title="witness_table" src="http://the-witness.net/news/wp-content/uploads/2010/09/witness_table-300x225.png" alt="" width="300" height="225" /></a></p>
<p>Here&#8217;s a close-up, with the opening scene of the game, as it silently waits for someone to sit down and play:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/waiting.jpg"><img class="aligncenter size-medium wp-image-476" title="waiting" src="http://the-witness.net/news/wp-content/uploads/2010/09/waiting-290x300.jpg" alt="" width="290" height="300" /></a></p>
<p>I had several reasons for wanting to show the game this way.  Firstly: At a show full of companies trying to capture your attention and sell you things, I wanted to do something that is subtle, and a surprise &#8212; if you notice it, and decide to investigate, you find something unexpected.</p>
<p>Also, I wanted people to be able to play the game for as long as they want, not feeling pressured to stop playing because of a huge line of antsy people waiting behind them.</p>
<p>Before PAX, only two people had ever played the game; those people were game developers, and the versions they played were very rudimentary.  This was the first time the game had ever been played by general players, and I wanted to see how people would react to it, as honestly as possible.  I didn&#8217;t want to give them any reason to think that this was a good game, or was by any designer they might have heard of.  So I just left the game running, and would occasionally peek at it from afar to see who was playing and how they were doing.</p>
<p>PAX is a huge show, with tons of stuff to see everywhere; if the game could hold peoples&#8217; attention under those conditions, purely on its own merits rather than by hype or pedigree, then I would know that it was really working.</p>
<p>Happily, the game worked very well &#8212; despite the fact that the visuals are still in an early prototype stage.  People tended to play for a long time, and they liked what they played.  Here&#8217;s a picture from Sunday; these guys played for a long time, perhaps an hour and a half:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/IMG_0138.jpg"><img class="aligncenter size-medium wp-image-474" title="IMG_0138" src="http://the-witness.net/news/wp-content/uploads/2010/09/IMG_0138-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Some game designers did recognize the game; here&#8217;s Dylan Fitterer (of <a href="http://www.audio-surf.com/" target="_blank">AudioSurf</a>) playing:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/IMG_0137.jpg"><img class="aligncenter size-medium wp-image-473" title="IMG_0137" src="http://the-witness.net/news/wp-content/uploads/2010/09/IMG_0137-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://kotaku.com/people/StephenTotilo/" target="_blank">Stephen Totilo of Kotaku</a> recognized the game early, on Friday, and found me camping out on the other side of the booth.  Thankfully, though, he didn&#8217;t spill the beans.</p>
<p>I am very happy with how this playtest session went.  I am glad I was able to bring a game directly to players, as a surprise.</p>
<p>The common wisdom among game designers is that the first time you put your game in the hands of players, it totally falls apart, and nothing works the way you expected.  Thankfully, that didn&#8217;t happen here.  The game does work as expected, despite being kind of crazy and experimental, and people enjoy playing it.</p>
<p>All that&#8217;s left now is just to do all the hard work required to finish the game!</p>
<p><strong>Update: </strong><a href="http://kotaku.com/5631002/a-tantalizing-session-with-the-witness-the-next-game-from-the-creator-of-braid" target="_blank">Stephen Totilo has posted his impressions, along with a gameplay video, at Kotaku</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=471</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Design Charrette</title>
		<link>http://the-witness.net/news/?p=463</link>
		<comments>http://the-witness.net/news/?p=463#comments</comments>
		<pubDate>Thu, 26 Aug 2010 03:59:47 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=463</guid>
		<description><![CDATA[Apparently, &#8220;charrette&#8221; is French for paste a bunch of stuff all over the walls and eat fast food and think about design ideas until everyone is very tired, as I learned this past Sunday from a group of seasoned architects.  We performed such a charrette in order to start figuring out what the locations in [...]]]></description>
			<content:encoded><![CDATA[<p>Apparently, &#8220;charrette&#8221; is French for <em>paste a bunch of stuff all over the walls and eat fast food and think about design ideas until everyone is very tired</em>, as I learned this past Sunday from a group of seasoned architects.  We performed such a charrette in order to start figuring out what the locations in the game are going to be like, architecture-wise.  This photo taken by David Hellman captures the mood very well:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/08/photo.jpg"><img class="aligncenter size-medium wp-image-466" title="photo" src="http://the-witness.net/news/wp-content/uploads/2010/08/photo-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>A few of the many, many ideas we looked at:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/08/099.jpg"><img class="aligncenter size-medium wp-image-465" title="099" src="http://the-witness.net/news/wp-content/uploads/2010/08/099-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Here&#8217;s David, looking like he&#8217;s at the top of his game:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/08/093.jpg"><img class="aligncenter size-medium wp-image-464" title="093" src="http://the-witness.net/news/wp-content/uploads/2010/08/093-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=463</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Island Paint-Over</title>
		<link>http://the-witness.net/news/?p=459</link>
		<comments>http://the-witness.net/news/?p=459#comments</comments>
		<pubDate>Wed, 25 Aug 2010 05:59:26 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=459</guid>
		<description><![CDATA[Shannon just did our first draft of a paint job on the island terrain.  These are still very much placeholder graphics, but it is starting to look reasonable, with the exception of the ugly green area in the foreground!

We&#8217;ll be working on that ugly green area soon&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Shannon just did our first draft of a paint job on the island terrain.  These are still very much placeholder graphics, but it is starting to look reasonable, with the exception of the ugly green area in the foreground!</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.24__time_22_10_n01.jpg"><img class="aligncenter size-medium wp-image-460" title="shot_2010.08.24__time_22_10_n01" src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.24__time_22_10_n01-300x168.jpg" alt="" width="300" height="168" /></a></p>
<p>We&#8217;ll be working on that ugly green area soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=459</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Island Shrinkage</title>
		<link>http://the-witness.net/news/?p=447</link>
		<comments>http://the-witness.net/news/?p=447#comments</comments>
		<pubDate>Thu, 19 Aug 2010 04:59:11 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=447</guid>
		<description><![CDATA[In the previous update I talked about how, despite the fact that The Witness is an &#8220;open-world&#8221; game, we are trying to make the environment as compact as possible.
Today I took a step in that direction by moving some areas around and compacting the island, changing its shape a bit:

Here&#8217;s a shot from the other [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://the-witness.net/news/?p=424">the previous update</a> I talked about how, despite the fact that The Witness is an &#8220;open-world&#8221; game, we are trying to make the environment as compact as possible.</p>
<p>Today I took a step in that direction by moving some areas around and compacting the island, changing its shape a bit:</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_03_n01.jpg" target="_blank"><img class="aligncenter size-medium wp-image-448" title="shot_2010.08.18__time_21_03_n01" src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_03_n01-300x192.jpg" alt="" width="300" height="192" /></a></p>
<p>Here&#8217;s a shot from the other side of the island, where you can see that there is plenty of empty space left:</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_03_n02.jpg" target="_blank"><img class="aligncenter size-medium wp-image-448" title="shot_2010.08.18__time_21_03_n02" src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_03_n02-300x192.jpg" alt="" width="300" height="192" /></a></p>
<p>So-me of this will be filled with new gameplay, some will be removed or reshaped, etc, depending on how things evolve.</p>
<p>Here&#8217;s a close-up of a new area; there&#8217;s something going on there with a lot of wires, and stuff:</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_04_n03.jpg" target="_blank"><img class="aligncenter size-medium wp-image-450" title="shot_2010.08.18__time_21_04_n03" src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.18__time_21_04_n03-300x192.jpg" alt="" width="300" height="192" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=447</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Why aren&#8217;t video games satisfying?</title>
		<link>http://the-witness.net/news/?p=438</link>
		<comments>http://the-witness.net/news/?p=438#comments</comments>
		<pubDate>Tue, 17 Aug 2010 13:01:38 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=438</guid>
		<description><![CDATA[Why can&#8217;t video games give me a powerful, high-density experience, so that after 3 hours I am satisfied, I feel like I have had enough?  Wouldn&#8217;t that be cool?
A movie can give you a satisfying experience in 2 hours.
A painting or a sculpture can give you a satisfying experience in 10 minutes.
A song can [...]]]></description>
			<content:encoded><![CDATA[<p>Why can&#8217;t video games give me a powerful, high-density experience, so that after 3 hours I am satisfied, I feel like I have had enough?  Wouldn&#8217;t that be cool?</p>
<p>A movie can give you a satisfying experience in 2 hours.</p>
<p>A painting or a sculpture can give you a satisfying experience in 10 minutes.</p>
<p>A song can give you a satisfying experience in 3 minutes.</p>
<p>What is it about certain kinds of linear-experience games that makes players feel they need to play them for hours upon hours in order to accrue a satisfying experience?  If it really takes that long, doesn&#8217;t that mean the medium is somehow deficient in important ways?</p>
<p>Gamers seem to praise games for being addicting, but doesn&#8217;t that feel a bit like Stockholm syndrome?  If you spend 20 hours playing a game, but the good parts could have been condensed into 3, then didn&#8217;t you just waste 17 hours?</p>
<p>If you waste 17 hours a month for the rest of your life, what is the cost of that, socially, quality-of-life-wise, economically, or however else you want to measure?</p>
<p>I am not saying that all games should be short.  Certainly there&#8217;s a place for long-form games, just as there&#8217;s a place for long-form TV shows like Deadwood or Lost.  But if we lived in a world where all cinema had to be the length of Lost, and films like Inception were criticized by cinema fans, and given lower scores in reviews and such, for being too short&#8230; wouldn&#8217;t that be perverse?  Certainly the people in that world would be ignoring a big chunk of the potential of that medium, for arbitrary and weird reasons.</p>
<p><P><br /><P><BR></p>
<p><em>This post is part of an industry-wide commentary by indie developers on the subject of short games.  Other participants:</em></p>
<p><a href="http://2dboy.com/2010/08/17/too-short/">Ron Carmel of 2DBoy</a></p>
<p><a href="http://www.hobbygamedev.com/spx/short-videogame-design/">Chris DeLeon<br />
</a><br />
<a href="http://nygamedev.blogspot.com/2010/08/coming-up-short.html">Dave Gilbert of Wadjet Eye Games<br />
</a><br />
<a href="http://24caretgames.com/2010/08/16/does-game-length-matter/">Matt Gilgenbach of 24 Caret Games<br />
</a><br />
<a href="http://www.spyeart.com/misc/gamelength_MichaelTodd.html">Michael Todd</a><br />
<a href="http://www.firehosegames.com/2010/08/how-much-is-enough/">Eitan Glinert of Fire Hose Games<br />
</a><br />
<a href="http://www.cliffski.com">Cliff Harris of Positech Games<br />
</a><br />
<a href="http://spyparty.com/2010/08/16/size-doesnt-matter-day/">Chris Hecker of Spy Party<br />
</a><br />
<a href="http://macguffingames.com/2010/if-size-doesnt-matter-where-do-you-get-the-virtual-goods">Scott Macmillan of Macguffin Games<br />
</a><br />
<a href="http://gamesfromwithin.com/size-matters">Noel Llopis<br />
</a><br />
<a href="http://retroaffect.com/blog/160/Size_Doesn_t_Matter_Day/">Peter Jones of Retro Affect<br />
</a><br />
<a href="http://www.copenhagengamecollective.org/2010/08/17/size-does-matter/">Lau Korsgaard<br />
</a><br />
<a href="http://brokenrul.es/blog">Martin Pichlmair of Broken Rules<br />
</a><br />
<a href="http://mile222.com/2010/08/a-haiku-about-game-length/">Greg Wohlwend of Intution Games<br />
</a><br />
<a href="http://blog.wolfire.com">Jeffrey Rosen of Wolfire<br />
</a><br />
<a href="http://www.enemyairship.com/2/The_Finite__Irreplaceable_Hours_of_Your_Life/">Steve Swink</a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=438</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Braid: A Movement Piece</title>
		<link>http://the-witness.net/news/?p=433</link>
		<comments>http://the-witness.net/news/?p=433#comments</comments>
		<pubDate>Thu, 12 Aug 2010 19:32:16 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=433</guid>
		<description><![CDATA[
The Chaparral High School Alumni Theatre’s production of Braid: A Movement Piece during the summer of 2010. Using a unique combination of content movement and contact improvisation dance techniques, Braid follows the story of young scientist Tim on his quest to find a Princess.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/user/CHSAlumniTheatre#p/c/B1317BA4D68EE747/0/e_wl7bInMIo"><img src="http://the-witness.net/news/wp-content/uploads/2010/08/braid.jpg" alt="" title="braid" width="635" height="359" class="aligncenter size-full wp-image-434" /></a></p>
<p><a href="http://www.youtube.com/user/CHSAlumniTheatre#p/c/B1317BA4D68EE747/0/e_wl7bInMIo">The Chaparral High School Alumni Theatre’s production of Braid: A Movement Piece</a> during the summer of 2010. Using a unique combination of content movement and contact improvisation dance techniques, Braid follows the story of young scientist Tim on his quest to find a Princess.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=433</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Island Today</title>
		<link>http://the-witness.net/news/?p=424</link>
		<comments>http://the-witness.net/news/?p=424#comments</comments>
		<pubDate>Thu, 05 Aug 2010 04:05:42 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=424</guid>
		<description><![CDATA[


We are starting to tinker around with the sky (this one is way too dark).  Also, moving around a bunch of locations and adding some new ones.
I&#8217;m doing a couple of weeks&#8217; worth of serious map organization / reorganization in order to get the game to a point where we can playtest it at [...]]]></description>
			<content:encoded><![CDATA[<p><P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.04__time_20_08_n01.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.04__time_20_08_n01-300x192.jpg" alt="The Witness: Island Snapshot" title="The Witness: Island Snapshot" width="300" height="192" class="aligncenter size-medium wp-image-425" /></a><br />
<P></p>
<p>We are starting to tinker around with the sky (this one is way too dark).  Also, moving around a bunch of locations and adding some new ones.</p>
<p>I&#8217;m doing a couple of weeks&#8217; worth of serious map organization / reorganization in order to get the game to a point where we can playtest it at pretty much any time, and whoever sits down to play will have a reasonable experience.  The game was in this kind of shape back in January, but we had to do a lot of work on game internals in order to get things where they needed to be, interactivity-wise, for the mid-stage of development.  Now that most of that stuff is done, it&#8217;s time to put the world/content back in playable shape; from there, new stuff can be added in a way that continuously fills out the world.  Once I feel like the world is &#8220;full enough&#8221; we can leave the preproduction phase and start going into production (which is where we start caring about what the graphics look like, start seriously doing voice recordings, etc).</p>
<p>One area I&#8217;ve been working on for the past few days is the start of the game.  It is meant to be a semi-guided experience that clues the player into what the game is about.  (If you remember the beginning of <em>Braid</em>, it&#8217;s something like that.)  You may have seen the interior of the house (the white building on the left) in earlier blog posts:</p>
<p><P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.04__time_20_09_n02.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2010/08/shot_2010.08.04__time_20_09_n02-300x192.jpg" alt="The Witness: Area just outside the house" title="The Witness: Area just outside the house" width="300" height="192" class="aligncenter size-medium wp-image-426" /></a><br />
<P></p>
<p>The area just outside the house is a constrained path, but very soon the player exits this area and can freely roam an open world.</p>
<p>Most open-world games want to impress you with the hugeness of the world, and the corollary to that is that you spend a lot of time walking / riding / driving between places.  <em>The Witness</em> takes the opposite philosophy: it wants the world to be as high-density as possible, just packed full of interesting things.  As the island develops, we will be placing areas as close to each other as we can, within constraints.  (<em>Braid</em> had a similar high-density philosophy &#8212; though it manifested in a different way &#8212; and many people appreciated that).</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=424</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>A game to watch for: Miegakure</title>
		<link>http://the-witness.net/news/?p=414</link>
		<comments>http://the-witness.net/news/?p=414#comments</comments>
		<pubDate>Sat, 17 Jul 2010 09:20:20 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Other Games]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=414</guid>
		<description><![CDATA[
Miegakure, by Marc ten Bosch, is a puzzle game where you travel through four-dimensional space (and manipulate objects in that space).  I was privileged to play an early version in 2009; just this week I got to play the most recent version, and it is coming along tremendously.  It is my Game of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://the-witness.net/news/wp-content/uploads/2010/07/meigakure-495x300.jpg"><img class="aligncenter size-full wp-image-415" title="&quot;Dense&quot;, a scenario in Miegakure." src="http://the-witness.net/news/wp-content/uploads/2010/07/meigakure-495x300.jpg" alt="" width="495" height="300" /></a><br />
Miegakure, by Marc ten Bosch, is a puzzle game where you travel through four-dimensional space (and manipulate objects in that space).  I was privileged to play an early version in 2009; just this week I got to play the most recent version, and it is coming along tremendously.  It is my Game of the Year, though it is unlikely to be released this year.  I find it easy to think of Miegakure as one of the great puzzle games of all time.</p>
<p>If I can be said to have an agenda in game design, it has something to do with mind-expansion.  Because of that, I very much appreciate it when other designers make games with that kind of intention.  Games that are truly mind-expanding are very rare and very difficult to make, but this is one of them.</p>
<p>Keep an eye out for this game, and when it comes out, play it.  Since it will be a while before release, so there&#8217;s no demo available.<br />
<P><br />
<a href="http://marctenbosch.com/miegakure/">Here&#8217;s an introduction to the game</a>.</p>
<p>Here&#8217;s an <a href="http://www.gamasutra.com/view/news/27041/Road_To_The_IGF_Miegakures_Marc_Ten_Bosch.php">interview Marc did with Gamasutra</a> with further details.</p>
<p>To keep up with news on the game, you can <a href="http://marctenbosch.com/news/">subscribe to Marc&#8217;s blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=414</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hey, who is making this game?</title>
		<link>http://the-witness.net/news/?p=408</link>
		<comments>http://the-witness.net/news/?p=408#comments</comments>
		<pubDate>Thu, 15 Jul 2010 07:43:28 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=408</guid>
		<description><![CDATA[Some people have been asking me about the team working on the game.  If you click up there on the About link at the top of the page, you&#8217;ll now find a short description of everyone working on The Witness, which I&#8217;ll paste below for your convenience:

The Witness is an exploration-puzzle game, to be [...]]]></description>
			<content:encoded><![CDATA[<p>Some people have been asking me about the team working on the game.  If you click up there on the About link at the top of the page, you&#8217;ll now find a short description of everyone working on The Witness, which I&#8217;ll paste below for your convenience:<br />
<span id="more-408"></span></p>
<p><em>The Witness</em> is an exploration-puzzle game, to be released on multiple platforms — whatever makes sense in late 2011, when the game will hopefully be finished.</p>
<p>The game is being developed by a small, independent team, a mix of full-timers and contractors.  Here&#8217;s a list:</p>
<p><P><br />
<strong>Jonathan Blow</strong><br />
Jonathan is a designer-programmer whose goal is to make games that are mind-expanding in ways special to this medium.  He is best known for the well-received game <em><a href="http://braid-game.com">Braid</a></em>.  He is also a partner in the <a href="http://www.indie-fund.com/">Indie Fund</a>, an initiative to help creative new developers grow stronger while remaining independent.  He speaks frequently at conferences and universities on the advancement of game design as an art form. </p>
<p><P><br />
<strong>Ignacio Casta&ntilde;o</strong><br />
Ignacio started programming at an early age and became obsessed with graphics. That led him to work at several game companies including Crytek, Relic and Oddworld. More recently he worked at NVIDIA, where he contributed to the design of modern graphics hardware, APIs, and programming models. Today he&#8217;s the father of a 3 year old boy and embraces all aspects of human experience.</p>
<p><P><br />
<strong>Shannon Galvin</strong><br />
Shannon Galvin has worked on games for over 16 years, having started on a game called &#8216;SimTown&#8217; and then adding pretty pictures to many others&#8230;including SimCity 2000, Sims 2 and Spore. When not doing art, he often wanders around games looking at environments and using cheat codes when monsters try to interrupt his art appreciation. Oh, and he&#8217;s got a ceramic kiln in his living room. Those things can vaporize metal! (Caution: Kilns should not be used to vaporize metal).</p>
<p><P><br />
<strong>Andrew Hynek</strong><br />
Andrew Hynek has been a game programmer since the early PS2 days.  Having worked at small and large studios on a variety of genres, he is trying out the indie / freelancing life at his new company, <a href="http://www.atrophystudios.com/">Atrophy Studios</a>.</p>
<p><P><br />
<strong>Andrew Lackey</strong><br />
Andrew loves sound, nails on chalk board and all.  As a gamer and indie music/film/game fan, he&#8217;s thrilled to connect with the team on the Witness.  Music and sound have been a part of his life since day one, but he got his professional start in Los Angeles on feature films.  <em>Go!</em>, <em>The Matrix Trilogy</em>, <em>8 Mile</em>, and <em>Treasure Planet</em> were among the 30+ films he worked on as a sound editor and foley supervisor. In 2004, he defected to San Francisco and shortly thereafter&#8230; the game industry.  After a brief stint at Skywalker Sound, he went to work for Electronic Arts as a senior sound designer.  He worked on several titles including the creature voices and sound design for Spore and Dead Space&#8230;although in decidedly different veins.  In late 2008, he went indie and started <a href="http://www.wabisabisound.com/">Wabi Sabi Sound</a>.  It&#8217;s been a great ride.  He&#8217;s contributed to <em>BioShock 2</em>, <em>Left 4 Dead 2</em>, <em>Dante&#8217;s Inferno</em>, and currently <em>The Witness</em>.  The nonconforming push of the envelope is a space he&#8217;s always thrived in.  <em>The Witness</em> challenges him to rethink the fundamentals of a craft he&#8217;s been doing for over 10 years&#8230;. he loves that!</p>
<p><P><br />
<strong>Nicholas &#8220;Indy&#8221; Ray</strong><br />
Nicholas has been programming professionally for 8 years.  He first worked as a game developer at the U.S. Army-funded &#8220;America&#8217;s Army&#8221; video game project. He has wide programming experience, ranging from compiler design to animation, and spends much of his time time trying to come up with unique solutions to problems, while stubbornly holding onto the conviction that byte-level data transformation is what programming is all about.</p>
<p>When not programming, he enjoys rock climbing in the summer, various snow sports in the winter, getting lost, and most anything that involves making a fool of himself.</p>
<p><P><br />
<strong>Eric Urquhart</strong><br />
At the age of 7 when Eric won his local community dental art contest by designing a fluffy rabbit with a big shiny tooth. It was then when he knew he could be on to something. So he started practicing painting on his bedroom walls. That wasn’t a big hit with the parents but did serve as good experience for his future as a mural artist.  Eric quickly became sought after for his mural work, being flown around the nation to add his personal touch to structures all around the country.  Six years ago he set down his analog brush and paints for a Wacom tablet and Photoshop. Since then he has been unleashing his artistic talent in feature film, television and the gaming industries. Past companies and clients Eric has worked for and with include Sony Pictures Imageworks, Warner Bros., Fuel and Brand New School.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=408</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Location Development</title>
		<link>http://the-witness.net/news/?p=385</link>
		<comments>http://the-witness.net/news/?p=385#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:37:34 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=385</guid>
		<description><![CDATA[To start off, here&#8217;s the customary island snapshot:

It may not look tremendously different from the last one, aside from the translucent water and added objects at the near corner.  However, a number of locations have been worked on in the past few weeks, which happen to be either far across the map or underground, so [...]]]></description>
			<content:encoded><![CDATA[<p>To start off, here&#8217;s the customary island snapshot:</p>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_02_n05.jpg" title="" class="shutterset_singlepic92" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/92__320x240_shot_2010-07-11__time_18_02_n05.jpg" alt="Island Snapshot" title="Island Snapshot" />
</a>

<p><P><br />
It may not look tremendously different from the last one, aside from the translucent water and added objects at the near corner.  However, a number of locations have been worked on in the past few weeks, which happen to be either far across the map or underground, so I figured I&#8217;d post some highlights.</p>
<p>Keep in mind that all of this is placeholder graphics; because we consider gameplay to be very important, we are planning out the gameplay carefully before we go into full production.</p>
<p>This area is an old ruin carved from stone; as the world gets developed, the area around it will become more deserty.  In a later blog update I&#8217;ll show this area more extensively:</p>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_01_n03.jpg" title="" class="shutterset_singlepic90" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/90__320x240_shot_2010-07-11__time_18_01_n03.jpg" alt="shot_2010-07-11__time_18_01_n03" title="shot_2010-07-11__time_18_01_n03" />
</a>
<br />
<span id="more-385"></span></p>
<p><P><br />
Here&#8217;s  a cave at a junction of underground tunnels, lit by colored lights so that you know which tunnel is which:</p>
<p>
<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_01_n01.jpg" title="" class="shutterset_singlepic89" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/89__320x240_shot_2010-07-11__time_18_01_n01.jpg" alt="shot_2010-07-11__time_18_01_n01" title="shot_2010-07-11__time_18_01_n01" />
</a>

<p><P><br />
A cathedral, built on a hill; its walls are old and crumbling, but it&#8217;s been well-cared-for:</p>
<div>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_02_n04.jpg" title="" class="shutterset_singlepic91" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/91__320x240_shot_2010-07-11__time_18_02_n04.jpg" alt="shot_2010-07-11__time_18_02_n04" title="shot_2010-07-11__time_18_02_n04" />
</a>

<p><P><br />
At the edge of the forest, near a bridge across the river, someone has been cutting down trees.  What was going on here?  Why did they just leave these logs laying around?</p>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_05_n06.jpg" title="" class="shutterset_singlepic93" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/93__320x240_shot_2010-07-11__time_18_05_n06.jpg" alt="shot_2010-07-11__time_18_05_n06" title="shot_2010-07-11__time_18_05_n06" />
</a>

<p><P><br />
We&#8217;ve also been working on rendering for grass, bushes, and trees.  Here&#8217;s a shot containing some of our new grass:</p>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-04__time_19_26_n02.jpg" title="" class="shutterset_singlepic88" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/88__320x240_shot_2010-07-04__time_19_26_n02.jpg" alt="shot_2010-07-04__time_19_26_n02" title="shot_2010-07-04__time_19_26_n02" />
</a>

<p><P><br />
Trees and bushes used to cast overly-dark, jagged shadows, because the shadow system didn&#8217;t know how to look at their texture maps to figure out transparency.  That&#8217;s been fixed, and now shadows cast by leaves are the shapes of the leaves:</p>

<a href="http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_06_n07.jpg" title="" class="shutterset_singlepic94" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/94__320x240_shot_2010-07-11__time_18_06_n07.jpg" alt="shot_2010-07-11__time_18_06_n07" title="shot_2010-07-11__time_18_06_n07" />
</a>

<p><P><br />
Much of the other work that I personally have been putting into the game is about the user interface for the puzzles.  As I mentioned, gameplay is the utmost concern; this being a puzzle game, you spend a long time solving puzzles, so it&#8217;s important to make that feel good, even at this early stage.  There is still plenty of work to do there, but a very important aspect of the user interface has improved drastically this week, and I am very happy with the results.</p>
<p>More news as it comes!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=385</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The Indie Fund submissions process is now open&#8230;</title>
		<link>http://the-witness.net/news/?p=375</link>
		<comments>http://the-witness.net/news/?p=375#comments</comments>
		<pubDate>Wed, 07 Jul 2010 03:34:09 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=375</guid>
		<description><![CDATA[&#8230; and the web site is updated.  See it here: http://indie-fund.com/
Earlier this year, some friends and I, all successful independent game developers, put together the Indie Fund in order to help support newer folks with good ideas.  All the hoops involved in setting up such an organization have been passed through, and we are now [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; and the web site is updated.  See it here: <a href="http://indie-fund.com/">http://indie-fund.com/</a></p>
<p>Earlier this year, some friends and I, all successful independent game developers, put together the Indie Fund in order to help support newer folks with good ideas.  All the hoops involved in setting up such an organization have been passed through, and we are now open for general submissions.  If you are an independent developer who needs money for a project-in-progress, go check out the Apply page to see what kinds of games we are looking for.</p>
<p>Thanks, and good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=375</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Island Snapshot</title>
		<link>http://the-witness.net/news/?p=370</link>
		<comments>http://the-witness.net/news/?p=370#comments</comments>
		<pubDate>Tue, 01 Jun 2010 03:47:47 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=370</guid>
		<description><![CDATA[The addition of the recently-discussed terrain editing code means that we can start giving the island more shape and character, in a natural way.  This is early yet&#8230;

]]></description>
			<content:encoded><![CDATA[<p>The addition of the recently-discussed <a href="http://the-witness.net/news/?p=345">terrain editing code</a> means that we can start giving the island more shape and character, in a natural way.  This is early yet&#8230;</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/06/shot_2010.05.31.20_06_n01.jpg"><img class="aligncenter size-medium wp-image-371" title="shot_2010.05.31.20_06_n01" src="http://the-witness.net/news/wp-content/uploads/2010/06/shot_2010.05.31.20_06_n01-300x187.jpg" alt="" width="300" height="187" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=370</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Kriging is cool.</title>
		<link>http://the-witness.net/news/?p=345</link>
		<comments>http://the-witness.net/news/?p=345#comments</comments>
		<pubDate>Mon, 24 May 2010 06:46:10 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=345</guid>
		<description><![CDATA[In The Witness we decided that it&#8217;s a good idea to have a heightfield terrain making up the bulk of the island surface.  The advantages of this are in rendering performance and in ease of texturing (it is relatively easy, with one continuously-parameterized terrain block, to get rid of seams; if your terrain is a [...]]]></description>
			<content:encoded><![CDATA[<p>In <em>The Witness</em> we decided that it&#8217;s a good idea to have a heightfield terrain making up the bulk of the island surface.  The advantages of this are in rendering performance and in ease of texturing (it is relatively easy, with one continuously-parameterized terrain block, to get rid of seams; if your terrain is a bunch of otherwise-unrelated meshes, then what do you do?)  <span id="more-345"></span> When we made this decision it seemed clear to me that the biggest disadvantage, for this game at least, was authoring the terrain.  There are typically a few different ways that large heightfields are built:</p>
<ol>
<li>Use an external terrain editing tool and then write an importer for its file format</li>
<li>Build a terrain editing tool into the game&#8217;s editor (this will require a bunch of work to do a good job, and will have fewer features than an external tool but they may be more appropriate for your game; also, you can make reasonable things happen to entities placed in the world when you interactively move the terrain around)</li>
<li>Paint heightmaps in an image editor like Photoshop and hotload those from the game engine (requires much less programming; doesn&#8217;t provide many features, but you have very fine control over the results; unfortunately, the editing process becomes pretty cumbersome)</li>
</ol>
<p>These seemed to be the main approaches on offer.  However, I wasn&#8217;t enthusiastic about doing any of the traditional things; I have written a number of terrain systems for games, and what bugged me, with respect to this game, was the way in which terrain handling tends to be very different from laying out objects in the world, and how this creates an extremely disjoint work process.</p>
<p>In concrete terms, this means that terrain was not going to be as malleable as the other objects in the world.  I am taking a very rough-drafty approach to the game; we are building areas, then moving them across the world if we feel they will work better somewhere else, rotating them as a group, etc.  The goal is to build a very-cohesive game world in which carefully-tuned gameplay is the most important thing &#8212; where we more-or-less have a rough draft of the whole world set up before we go in and try to get serious about how everything looks.</p>
<p>This kind of approach just dies when you have elements that behave very differently, and are difficult to manipulate together, such as terrain and objects.  If I have two hills with a path winding between them, a bench by the path with a book upon the bench, and a signpost nearby, what happens when I want to move that scene across the map and then rotate it by 30 degrees?  With the entities, it is no problem, we just do that in the editor.  But with the terrain it just becomes a mess to move the hills at all, regardless of which of the above approaches are used.  And if you want to move and rotate the hills in sync with the entities so that the whole scene is intact&#8230; <strong>good luck!</strong></p>
<p>To solve this problem, terrain needed to be built in the in-game editor, in a way that would be maximally malleable &#8212; so that I can pick up a hill and rotate and drag it.  Because of the requirement for rotation, you can&#8217;t really be manipulating samples directly; it has to be control surfaces of some kind (because if you are just blitting samples around, a few rotation operations are going to mangle whatever original shapes you made).</p>
<p>As for control surfaces, the first ideas that come to mind are things like spline patches.  But the problem with spline patches is that you have to be very careful managing the control points in a patch, and they ultimately aren&#8217;t that malleable &#8212; what if I want to split a patch in half without changing the shapes of areas near the edges?  What if I want to move one small, high-detail terrain area so that it overlaps somewhat with a big, low-detail area?  How is that going to work?  And if I have spline patches, then any time I instantiate a new grid of patches, I have to manage a bunch of individual control points, which is labor-intensive.  If I am rough-drafting, I want to do the minimum possible work to lay out a given area.  If I just generally want to build a hill but don&#8217;t care much about its shape, I ought to be able to do that with just 2 or 3 control points, arbitrarily-placed.</p>
<p>Clearly what I wanted was a system that would just look at a set of unstructured control points &#8212; no topology or anything &#8212; and generate a terrain from those points in the local area.  When there is no topology or parameterization, you can merge and split groups of control points at will; you can have them overlap; you can do whatever you want.</p>
<p>I started putting together an ad hoc scheme for doing this, but did not take it very far before discovering that the mathematics for doing a good job at exactly this problem had already been invented decades ago.  The method is called <a href="http://en.wikipedia.org/wiki/Kriging">Kriging</a>, and it is well known in geostatistics.  If you&#8217;ve got a survey of height field data (or any other field data &#8212; the density of a mineral at certain points, for instance), and that data is missing values for some locations, Kriging will give you a reasonable guess at the values of the field at the unknown points.</p>
<p>For rough-draft terrain modeling, we can turn the idea around; if we give a Kriging function only a small set of known data points, it will do a quite fantastic job of filling in the values at all the other points.  The basic math involves the inverse of an n by n matrix, where n is the number of known data points.  In theory that could become a huge computation, but for the number of points we may typically have in one local area of the map, the computation is easy for modern CPUs.  Kriging is not hard to implement; I started with some public domain code written at a university and modified it for our needs (though this basically involved rewriting it, as it was messy and had some serious bugs!  If anyone wants our version of the Kriging code, drop me a line).</p>
<p>Here&#8217;s how we have it integrated into our game engine.  There&#8217;s a type of object that exists as a set of terrain control points, which can be moved around the world arbitrarily, just like anything else.  It looks like this:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-1.jpg" title="" class="shutterset_singlepic75" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/75__400x300_untitled-1.jpg" alt="untitled-1" title="untitled-1" />
</a>

<p>The only meaningful data in this object, with respect to terrain shaping, are the positions of the control points (purple boxes).  The surface is just a visualization; it tells you what surface these points would define if they were the only control points in the universe.  (Though actually, the surface defined by those points would extend infinitely in all directions; this visualization stays within the convex hull of the control points, which helps you see what you are doing when editing).</p>
<p>Right now these control points haven&#8217;t actually been applied to the game&#8217;s terrain (green surface below); they are just hovering above it.  Here&#8217;s a shot from another angle:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-2.jpg" title="" class="shutterset_singlepic80" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/80__400x300_untitled-2.jpg" alt="untitled-2" title="untitled-2" />
</a>

<p>I can press a key to add a new control point to this object:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-3.jpg" title="" class="shutterset_singlepic81" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/81__400x300_untitled-3.jpg" alt="untitled-3" title="untitled-3" />
</a>

<p>The new control point doesn&#8217;t affect the shape of the old surface in any way, which is very convenient.  I can drag the new control point at will:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-4.jpg" title="" class="shutterset_singlepic82" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/82__400x300_untitled-4.jpg" alt="untitled-4" title="untitled-4" />
</a>

<p>Or add many more control points:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-5.jpg" title="" class="shutterset_singlepic83" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/83__400x300_untitled-5.jpg" alt="untitled-5" title="untitled-5" />
</a>

<p>Here&#8217;s that same visualization surface, with the control points and gridding turned off, so you can see it better:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-6.jpg" title="" class="shutterset_singlepic84" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/84__400x300_untitled-6.jpg" alt="untitled-6" title="untitled-6" />
</a>

<p>Then, when I decide I like the shape, I can press another key to apply these control points to the game&#8217;s terrain:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-7.jpg" title="" class="shutterset_singlepic85" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/85__400x300_untitled-7.jpg" alt="untitled-7" title="untitled-7" />
</a>

<p>(Now there&#8217;s a lot of z-fighting between the control surface and the terrain because they are in pretty much the same place.)</p>
<p>Here is the terrain with the control surface hidden.  Note that the terrain values have been smoothly interpolated, even in areas outside the control object:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-8.jpg" title="" class="shutterset_singlepic86" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/86__400x300_untitled-8.jpg" alt="untitled-8" title="untitled-8" />
</a>

<p><em>(By the way, those seams you see in the previous two pictures are lighting seams.  These don&#8217;t have anything to do with Kriging, it&#8217;s just that the terrain blocks don&#8217;t know how to look up their neighbors&#8217; height values when generating their surface normals.  Any block-based terrain system has to solve a similar problem.  It&#8217;s easy to solve, but at a low priority on the to-do list, hence it hasn&#8217;t been done yet.  The distance between seams tells you how big the terrain blocks are, so the seams are sort of useful in this image!)</em></p>
<p><em><span style="font-style: normal;">Suppose this control surface is part of a scene that I want to reorient.  I&#8217;ll rotate it about 70 degrees clockwise (now you&#8217;ll see the surface intercutting more-heavily with the existing terrain values):</span></em></p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-9.jpg" title="" class="shutterset_singlepic87" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/87__400x300_untitled-9.jpg" alt="untitled-9" title="untitled-9" />
</a>

<p>And then once again, I apply Kriging to the terrain, generating the same hills in a rotated orientation:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-10.jpg" title="" class="shutterset_singlepic76" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/76__400x300_untitled-10.jpg" alt="untitled-10" title="untitled-10" />
</a>

<p>To illustrate the way that interpolation is not confined to a single control object, and that in fact this is a control point soup, here I&#8217;ve created three control objects:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-11.jpg" title="" class="shutterset_singlepic77" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/77__400x300_untitled-11.jpg" alt="untitled-11" title="untitled-11" />
</a>

<p>And here&#8217;s what the terrain looks like with them applied:</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-12.jpg" title="" class="shutterset_singlepic78" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/78__400x300_untitled-12.jpg" alt="untitled-12" title="untitled-12" />
</a>

<p>And here&#8217;s the final terrain along with the control objects (lots of z-fighting again):</p>

<a href="http://the-witness.net/news/wp-content/gallery/kriging/untitled-13.jpg" title="" class="shutterset_singlepic79" >
	<img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/cache/79__400x300_untitled-13.jpg" alt="untitled-13" title="untitled-13" />
</a>

<p>Hopefully that&#8217;s enough screenshots to illustrate the point.  Compared to splines, Kriging has the following highly beneficial properties (aside from the huge benefits of not requiring a topology, discussed above):</p>
<ul>
<li>Always interpolates every control point exactly</li>
<li>Adding a new control point does not change the existing surface at all.</li>
<li>No funny spline-like behavior (curves appearing in strange places, huge overshoots, etc)</li>
</ul>
<p><P>&nbsp;<P><br />
<strong>Hacking In Compact Support</strong></p>
<p>When doing Kriging in a video game, you probably don&#8217;t want to compute the terrain for the entire world at once for every change, because that would be very expensive, and it also is a little bit unintuitive (since a change to a control point very far away could change some interpolated terrain nearby, even if only slightly).  However, the vanilla Kriging algorithm would require global computation and thus behave nonlocally.  For <em>The Witness</em> we clearly wanted our control points to affect only nearby areas, <em>i.e.</em> have compact support.  My first attempt at this was:</p>
<ul>
<li>Pick a radius r0 at which any control point has maximum effect, and a larger radius r1 at which the point has no effect, with smooth interpolation in-between.</li>
<li>Terrain consists of contiguous blocks 33&#215;33 samples in size.</li>
<li>For each block of terrain you want to Krige, find all control points whose distance in the XY plane from any sample in the block is less than r1 <em>(these are all the control points that could possibly affect any sample in the block).</em></li>
<li>Pass all these points to the Kriging routine, which computes every sample in the block.  It does this by building an inverse variogram matrix &#8212; square with dimension (n+1) &#8212; and performing one matrix-vector multiply for each terrain sample, which is pretty fast.</li>
<li>For each sample, the Kriging routine gives us the set of weights we would use to blend each control point if the control points did not have compact support.  To provide compact support, just compute an additional factor that is (distance &#8211; r1) / (r0 &#8211; r1) clamped to [0, 1], multiply all the weights by these factors, and then re-normalize the weights (ensure they all add to 1).</li>
</ul>
<p><P><br />
This almost works, but not quite; we get discontinuities between terrain blocks (which should not happen if everything is correct, since two vertices at the same XY position should always get the same Z value).  At first I thought this was a programming error, but after looking more closely at the situation I convinced myself that the reason is mathematical.  My assumption had been that a control point with a weight of 0 will have the same effect as a control point that never enters into the calculation, but this seems not to be true.</p>
<p>The step that I added, multiplying the compact-support factors against the weights provided by the matrix-vector multiply, is &#8212; by the distributive property &#8212; the same as multiplying each row of the matrix by the support factor before doing the matrix-vector multiply.  If a support factor is 0, then this makes the matrix rank-deficient, <em>i.e.</em> it could not have been the result of an inversion, which means that this step is not compatible with the mathematical technique being applied.  The idea of a 0 blend factor just isn&#8217;t valid.  <em>(This also brings into question whether the idea of multiplying by the support factors is valid at all, but for now I will just observe that it produces very useful and convenient behavior.  However, there are some small stepping artifacts that I see in some locations.  I think these may be due to having too-low a density of control points in the world (some terrain samples having 0 control points inside r1) but there&#8217;s a possibility that they aren&#8217;t, and have something to do with the weighting procedure itself.  I haven&#8217;t investigated yet.)</em></p>
<p>Now, as I type this, I am not 100% convinced that it is the right reasoning, and that something more like a typical programming error might be the problem.  My math is pretty rusty these days.  However, my updated version of the routine does not have discontinuities.  </p>
<p>Unfortunately, the fix for discontinuities has made the Kriging a bit slower.  What I do is, instead of building just one inverse variogram for the entire terrain block, I build a new variogram for every vertex, and include in that variogram only the control points that have nonzero support factors.  Thus the dimensions of the matrix will change from sample to sample, and I am inverting a new matrix for each output sample.</p>
<p>Unoptimized, this version of the algorithm takes between 5 and 25 seconds to recompute the terrain for the entire world, depending on how large r1 is.  This is fine for now, especially since editing operations only hit about 1/50 of the world or less at any given time.  However, it&#8217;ll get slower as more control points are added to the world.</p>
<p>Fortunately, this first version of the discontinuity-fixing was intended to be slow &#8212; I programmed it in the most straightforward way possible, to maximize the likelihood that it would work.  It is easy to think of ways to make it faster by caching the matrices, but it&#8217;s unclear which of these would be fastest.  For example, if you just cache one copy of the matrix and invalidate it any time a new control point comes into or out of range, then you might easily find yourself in a situation where you oscillate between recomputing two different matrices as you work your way along the sample grid.  This is a little reminiscent of the kinds of problems that 3D hardware has, which store images in a non-linear way so that they can be cache-efficient when sampled along lines in arbitrary directions&#8230; but it&#8217;s not clear to me how far to take that analogy or whether any applicable wisdom can be derived from it.</p>
<p>So I intend to optimize it, or come up with a faster solution to the discontinuity problem, but it&#8217;s not clear yet what form that will take.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=345</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>The island this week.</title>
		<link>http://the-witness.net/news/?p=337</link>
		<comments>http://the-witness.net/news/?p=337#comments</comments>
		<pubDate>Fri, 07 May 2010 17:31:20 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=337</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://the-witness.net/news/wp-content/uploads/2010/05/shot_new.jpg"><img class="aligncenter size-medium wp-image-338" title="shot_new" src="http://the-witness.net/news/wp-content/uploads/2010/05/shot_new-300x175.jpg" alt="" width="300" height="175" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=337</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>The island so far&#8230;</title>
		<link>http://the-witness.net/news/?p=328</link>
		<comments>http://the-witness.net/news/?p=328#comments</comments>
		<pubDate>Wed, 28 Apr 2010 00:25:55 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=328</guid>
		<description><![CDATA[I figured it would be fun to post occasional screenshots of the island so people can see it gradually come together over time.  Here&#8217;s the first one.
Keep in mind that this is all a rough draft for gameplay purposes, and none of this is supposed to look remotely like final game visuals.
Despite not looking fancy [...]]]></description>
			<content:encoded><![CDATA[<p>I figured it would be fun to post occasional screenshots of the island so people can see it gradually come together over time.  Here&#8217;s the first one.</p>
<p>Keep in mind that this is all a rough draft for gameplay purposes, and none of this is supposed to look remotely like final game visuals.</p>
<p>Despite not looking fancy yet, there&#8217;s already more than 5 hours of gameplay.  So that&#8217;s pretty good.</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2010/04/island.jpg"><img class="aligncenter size-medium wp-image-329" title="island" src="http://the-witness.net/news/wp-content/uploads/2010/04/island-300x187.jpg" alt="" width="300" height="187" /></a><em><br />
(Click image for full size.)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=328</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Shadow Maps (part 2): Save 25% texture memory, and possibly much more.</title>
		<link>http://the-witness.net/news/?p=113</link>
		<comments>http://the-witness.net/news/?p=113#comments</comments>
		<pubDate>Wed, 21 Apr 2010 21:41:09 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=113</guid>
		<description><![CDATA[In the previous part, I talked about my reasons for wanting to use Cascading Shadow Maps (one of the biggest: image stability), then said that we had implemented Michal Valient&#8217;s version of the algorithm, and mostly liked it, but wanted to reduce the memory usage.
This time I&#8217;ll show how to reduce the memory usage by 25% [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://the-witness.net/news/?p=77">the previous part</a>, I talked about my reasons for wanting to use Cascading Shadow Maps (one of the biggest: image stability), then said that we had implemented Michal Valient&#8217;s version of the algorithm, and mostly liked it, but wanted to reduce the memory usage.</p>
<p>This time I&#8217;ll show how to reduce the memory usage by 25% on machines that support non-power-of-two textures; or, on machines that don&#8217;t, how to fit 5 shadow maps in the space previously used for 4.</p>
<p><span id="more-113"></span><br />
Valient&#8217;s shadow system generates very stable shadow maps, but this costs a lot of texture memory.  Recall that so much memory is needed because you are inscribing your frustum slice inside a circle, and then inscribing that circle in the texture map:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/03/1slice.png"><img class="aligncenter size-full wp-image-100" title="1slice" src="http://the-witness.net/news/wp-content/uploads/2010/03/1slice.png" alt="" width="431" height="425" /></a></p>
<p>When implementing cascading shadow maps, you will be using more than one frustum slice: say, four or five.  Valient&#8217;s ShaderX 6 paper suggests a way to sample from four different shadow slices quickly in the shader by packing them into an atlas, perhaps like this:</p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/atlas2048x2048.png"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/thumbs/thumbs_atlas2048x2048.png" alt="atlas2048x2048" /></a></p>
<p>This was the way we implemented it at first, but very soon after that I was desiring a little more versatility.  If your graphics hardware will do non-power-of-two textures, then you may wish to have the number of shadow slices be an adjustable property; but if the texture maps are packed into a square like that, it&#8217;s hard to know where to put a fifth one.  So we changed the atlas layout to this:</p>
<p><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/atlas4096x1024.png" alt="atlas4096x1024" /></p>
<p>This still works on power-of-two hardware (power-of-two textures don&#8217;t have to be square!), and on more-versatile hardware, we can now easily add new textures onto the end.</p>
<p>When your atlas is laid out in a line like this, and you add some runtime visualization to your game, it becomes very clear how much texture space is going unused.  Here&#8217;s a shot from <em>The Witness</em>&#8217;s shadow maps:</p>
<p><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/green_frusta_1_0.png" alt="green_frusta_1" /></p>
<p>The frustum slices are shown in green.  Obviously there is a lot of empty space between them.  (For the purposes of visualization, we have left the pixels in the &#8220;empty space&#8221; filled with shadow map data, but anything that is not covered by green will never be visible in-game, so the game will run faster if we cull all that stuff!)</p>
<p>Because there&#8217;s so much empty space, we could move our shadow maps closer together, and use less memory.  But we need to be careful about it, because the whole point of the algorithm is that we need enough shadow map space to handle the worst case.  Indeed, if you turn the camera a bit, you get this:</p>
<p><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/green_frusta_2_0.png" alt="green_frusta_2" /></p>
<p>Now there is very little space between the maps, so you can&#8217;t squeeze them together.  Instead, all the space is toward the bottom of the atlas, and it is unclear how to use it effectively.</p>
<p>But there&#8217;s a trick we can apply.  Even though these shadow maps are all packed into one atlas, they are still indexed as separate units in the shader, which means we can transform them as separate units.  So why don&#8217;t we just rotate each individual shadow map by 90 degrees?  Here&#8217;s what happens to the image above when you do that:</p>
<p><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/green_frusta_3.png" alt="green_frusta_3" /></p>
<p>Now there is plenty of horizontal space and we can pack the maps all together!  (Of course we don&#8217;t need to render our shadow maps at the default orientation and then copy-and-rotate them in a post-pass; we can just rotate the up-vector of the camera used to render the shadow maps, so that we get the rotation for free.)</p>
<p>When we rotate the shadow maps like this, in order to render properly, our shader needs to realize that they are rotated; but Valient&#8217;s system already provided a way to transform the shadow map coordinates based on map index, so rotating the maps fits directly into that scheme.  Furthermore, if we are using any filter offsets to index into our shadow map, we need to ensure that those offsets get rotated (by either rotating the constants before uploading them to the shader, or by adding them before doing the map-to-atlas transform, depending on how your system is implemented).</p>
<p>So how do we figure out how to pack the frustum slices together?  Our implementation slides them to the left as far as we can make them go.  First, we compute bounding rectangles for the frustum slices (bounding rectangles shown in yellow):</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/yellow_rectangles.png" alt="yellow_rectangles" width="574" height="144" /></p>
<p>These rectangles are all oriented in the same direction, so we can just slide them to the left until they nearly touch:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/yellow_rectangles_packed.png" alt="yellow_rectangles_packed" width="574" height="144" /></p>
<p>We figure out the rectangle orientation by performing a brute-force uv-bounding computation on one of the frustum slices, then using that same orientation for all slices.  By &#8220;brute-force uv-bounding computation&#8221; I mean that we just try a whole bunch of different angles and see which one fits the tightest.  In the current implementation we try 100 different orientations spread over 90 degrees, so we find the best angle to within less than 1 degree of accuracy.  (You only need to try 90 degrees, because at that point every angle has been covered by at least one of the sides of your rectangle).</p>
<p>The initial instinct was to use Shadow Map 0 to compute the rectangle orientation, but this didn&#8217;t quite work out; because of the extreme pointiness of the first frustum slice, we sometimes end up with bounding rectangles that do not suit the other maps.  Using any of the other shadow maps solves this problem (because their near plane tends to create a coherent bounding edge).</p>
<p>We&#8217;re not done moving the shadow maps around.  Besides just shifting the later shadow maps leftward, as above, we save some more space by shifting the first shadow map leftward based on the leftmost vertex in its frustum slice.  (We don&#8217;t do it based on the yellow rectangle, because that rectangle will almost always be poking outside of the atlas already.  We don&#8217;t need to make sure the whole yellow rectangle is inside the atlas; just the green frustum slice!  Remember that the rectangles are just a tool to help us know how to pack.)  So then we get this:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/yellow_rectangles_packed_left.png" alt="yellow_rectangles_packed_left" width="574" height="144" /></p>
<p>And we can shave off even more space by shifting the rightmost map upward or downward, whichever direction will allow it to slide further to the left (in this case, it&#8217;s downward:)</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/yellow_rectangles_packed_right.png" alt="yellow_rectangles_packed_right" width="574" height="144" /></p>
<p>Clearly we&#8217;ve saved a lot of space &#8212; about half for this viewing angle.  But we have to allocate enough texture space for the worst case, and the question is, what is that worst case?  Empirically, for our game&#8217;s FOV, we find that in this worst-case viewing angle we can chop off 25% of the texture map.</p>
<p>If you&#8217;re on non-power-of-two texture hardware, you can just cut your map down and you are happy.  If you are power-of-two-only, you can&#8217;t do that, but you could use five frustum slices in the space that previously held only four.</p>
<p><strong>Dealing with Overlapping</strong></p>
<p>You can pack these rectangular areas together however you want, as long as they don&#8217;t overlap &#8212; at scene rendering time, your shader doesn&#8217;t know or care how close these regions are to each other.  Actually building the shadow maps in the first place has become a bit trickier, though.  When each shadow map was in its own self-contained square region, we would just set up a viewport for that square, erase the contents, and render into it.  But now, suppose we are rendering the shadow maps from left to right: while we are rendering the second shadow map, its viewport is going to inevitably overlap the first shadow map.  We have to be careful not to write into the valid region of that first shadow map, or else we&#8217;ll mess up the scene.</p>
<p>In our current implementation, we use DirectX9&#8217;s API-provided clipping planes for this purpose.  (The long sides of the yellow rectangles tell us exactly where to put our clipping planes. )  Clipping planes are deprecated in future versions of the API, so we would either switch to stencil testing or else do the clipping ourselves in the shaders.</p>
<p>Here&#8217;s what the neighborhood of the worst case looks like:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/worst_case.png" alt="worst_case" width="574" height="144" /></p>
<p>It happens when you are looking sort-of in the direction of the light vector, but you are turned enough to the side that the view frustum has rotated to be diagonal relative to the axes of the texture map space.  (If you are pointing directly along the light vector, your view frustum extrema are likely to be parallel to the axes of the texture map space.)</p>
<p><strong>Deeper Thinking We Have Not Yet Done</strong></p>
<p>We&#8217;ve saved this texture memory by doing what are essentially image-space operations.  But it seems to me that one could somehow project these operations back to the 3D space that we use to compute the bounding spheres in the first place, and generate smaller spheres.  The operation of rotating our texture maps means that we are folding our output space over on itself, using only half the possible orientations.  The whole point of the bounding sphere is to permit the use of any orientation at all &#8212; which we clearly, in retrospect, do not need.  So it&#8217;s probably possible to reformulate this algorithm in terms of a bounding hemisphere of some kind (or some shape that is somewhat near a hemisphere but allows frustum corner protrusions to poke out of it).</p>
<p><strong>Saving Tremendously More Memory, if you are willing to copy your maps or else render them in multiple pieces&#8230;</strong></p>
<p>The reason our system works is that once the shadow maps are packed into an atlas, the shader doesn&#8217;t know or care where the boundaries of the shadow maps are.  We can address the atlas at will, because in reality it is just one continuous texture map.  This means that we can go even further, and place some of our shadow maps in the atlas in such a way that they cross the boundaries of the atlas and wrap to the other side.  It looks discontinuous, but the shader being run at scene-render time does not care, if the texture is addressed in a wrapping mode.  Here is a messy mock-up (not the output from an actual running version, because we haven&#8217;t implemented this):</p>
<p>Unwrapped, easy-to-see version of texture space:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/wrap_1.jpg" alt="wrap_1" width="525" height="338" /></p>
<p>Wrapped vertically:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/wrap_2.jpg" alt="wrap_2" width="525" height="175" /></p>
<p>Wrapped horizontally:</p>
<p><img class="ngg-singlepic ngg-center" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/gallery/shadow-mapping-2-images/wrap_3.jpg" alt="wrap_3" width="324" height="175" /></p>
<p>In my done-by-hand mockup, the result is 46% the size required by the default packing in Valient&#8217;s original algorithm.  That&#8217;s a lot of memory savings.</p>
<p>The catch is that, while it&#8217;s easy to employ this mapping without additional expense, it&#8217;s more expensive to generate.  You have to either render a non-wrapped version of each shadow map and then copy it into its multiple destination pieces, or else you have to render each map in multiple passes.  (It&#8217;s always possible to arrange your maps so that one of them is unsplit, so for 4 frustum slices, you probably need 3 additional passes.  Each pass has fewer objects, though, so maybe it&#8217;s not too bad.)</p>
<p>If you are using pre-filtered shadow maps, then the filtering step is just a kind of copy anyway, so you would be able to do this packing essentially for free.  We aren&#8217;t doing any pre-filtering on <em>The Witness</em>, but if we do, it is likely we will switch over to this packing scheme.  The memory savings are so huge, how could we not?</p>
<p>But I&#8217;d like to reiterate for clarity that at this time we have not implemented this wrapping-shadow-map scheme, so if there are any hidden gotchas, I don&#8217;t know.  We have only implemented the above 25% savings scheme (sliding the maps around, no wrapping).</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Multi-lightmaps</title>
		<link>http://the-witness.net/news/?p=260</link>
		<comments>http://the-witness.net/news/?p=260#comments</comments>
		<pubDate>Mon, 12 Apr 2010 00:47:26 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=260</guid>
		<description><![CDATA[Ignacio has implemented the first version of the handling for light sources that change (doors that open or close, lights that can be switched on or off, etc).  The idea is that we just precompute different lightmaps for each of these cases and blend between them at runtime.  In the future (not the future of [...]]]></description>
			<content:encoded><![CDATA[<p>Ignacio has implemented the first version of the handling for light sources that change (doors that open or close, lights that can be switched on or off, etc).  The idea is that we just precompute different lightmaps for each of these cases and blend between them at runtime.  In the future (not the future of this game, but the general computer graphics future) when we have realtime global illumination, this would not be necessary; but for now this is much faster to compute and much easier to implement.  The drawback is that we have to think about the different cases in advance (things can&#8217;t be <em>too</em> dynamic) and the amount of lightmap storage space grows rapidly as the number of variables grows.</p>
<p>We don&#8217;t yet smoothly interpolate between the maps in the shader; we just switch the maps outright.  Interpolation is coming soon.  But in screenshots you can&#8217;t see changing conditions anyway, so it&#8217;s time for some screenshots.</p>
<p>First is the house with the door closed, then with the door open.  After that comes the sculpture room, with two light sources toggled in various ways (see the captions on each picture).  For now you&#8217;ll have to forgive the light leaking in the corners and the shadow speckles on the walls; they are due to issues with the dynamic shadow system (which is not really related to what is being shown here) and those issues have yet to be resolved!<br />
<center><br />

<div class="ngg-galleryoverview" id="ngg-gallery-5-260">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-49" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_06__1.jpg" title="House with the door closed." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_06__1" alt="witness_shot_2010_04_11_16_06__1" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_06__1.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-50" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_07__2.jpg" title="House with the door open.  Note the brighter lighting beneath the table and couch, and the splash of light on the far wall just above the sunlight coming in through the door." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_07__2" alt="witness_shot_2010_04_11_16_07__2" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_07__2.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-51" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_26__1.jpg" title="Sculpture room.  The only lighting is the permanently-open skylights (which are not visible in the frame)." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_26__1" alt="witness_shot_2010_04_11_16_26__1" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_26__1.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-53" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_27__3.jpg" title="Sculpture room.  Lightbulb is off; window is open." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_27__3" alt="witness_shot_2010_04_11_16_27__3" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_27__3.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-52" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_26__2.jpg" title="Sculpture room.  Lightbulb is on; window is closed." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_26__2" alt="witness_shot_2010_04_11_16_26__2" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_26__2.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-54" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/witness_shot_2010_04_11_16_27__4.jpg" title="Sculpture room.  Lightbulb is on; window is open." class="shutterset_set_5" >
								<img title="witness_shot_2010_04_11_16_27__4" alt="witness_shot_2010_04_11_16_27__4" src="http://the-witness.net/news/wp-content/gallery/multi-lightmaps-1/thumbs/thumbs_witness_shot_2010_04_11_16_27__4.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

<br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=260</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Texture Parameterization</title>
		<link>http://the-witness.net/news/?p=120</link>
		<comments>http://the-witness.net/news/?p=120#comments</comments>
		<pubDate>Tue, 30 Mar 2010 08:05:57 +0000</pubDate>
		<dc:creator>Ignacio Castaño</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=120</guid>
		<description><![CDATA[As explained by Jon in his previous post, we are using precomputed global illumination in The Witness, and one of my first tasks was to work on that system.
I have developed some interesting technology to compute automatic paramaterizations, to formulate the lighting computations in a way that can be easily mapped to the GPU, and [...]]]></description>
			<content:encoded><![CDATA[<p>As explained by Jon <a href="http://the-witness.net/news/?p=50">in his previous post</a>, we are using precomputed global illumination in <em>The Witness</em>, and one of my first tasks was to work on that system.</p>
<p>I have developed some interesting technology to compute automatic paramaterizations, to formulate the lighting computations in a way that can be easily mapped to the GPU, and to speed them up performing them at a lower frequency by using irradiance caching. None of these things are very cutting edge, but I run into some interesting problems that are usually overlooked in the literature and came up with some creative solutions that I think would be interesting to share. However, in retrospect, I think I also made some mistakes, but I hope that being honest about them will help me avoid them in the future.</p>
<p>In this first post I will describe the lightmap parameterization algorithm that I have implemented and in the next few posts I&#8217;ll cover other details of our lighting system such as our approach to perform final gathering using hemicubes and our implementation of irradiance caching.</p>
<p><span id="more-120"></span></p>
<p>In order to use precomputed lighting we need a way of mapping these lighting computations to the surfaces. One possibility is to store them per vertex, but in many cases that does not provide enough resolution and the interpolation of the lighting makes the triangulation of the mesh fairly obvious. Many games get away with that by compensating the lack of detail in the lighting with high texture and normal map detail, but that does not go along well with the graphical style that Jon wants to achieve. So, instead of that we decided to create full parameterizations of our objects in order to store the precomputed lighting into lightmap textures.</p>
<p>Creating these parameterizations by hand is possible, but it is time consuming and I&#8217;d rather have our artists work on something more enjoyable. So, we decided to create the parameterizations automatically. However, the greatest mistake I&#8217;ve made so far is to not look more carefully at the available solutions to accomplish that. I had some pieces of the implementation already available, and I overestimated how much effort it would take to put them together and produce robust results. While talking about this to some friends at GDC one of them asked why I wasn&#8217;t using <a href="http://msdn.microsoft.com/en-us/library/ee422528(VS.85).aspx">Microsoft&#8217;s UVAtlas</a> tool, and to my dismay and embarrassment my only answer was that it had not occurred to me. I think that goes to prove how valuable it is to be open about our development in a small team like ours.</p>
<p>Now that I got that out of the way, let&#8217;s talk about the tech. We only use lightmaps to represent indirect illumination and the direct illumination of static area lights. So, our expectation was that lightmaps would be fairly smooth and that seams would not be a huge problem. For this reason we decided not to invest in a solution that guaranteed seamless parameterizations and instead used a fairly traditional approach: We first divide the input geometry into charts with disk topology, parameterize them individually, and finally pack them into a rectangular texture.</p>
<h3>Segmentation</h3>
<p>Dividing the mesh into charts is by far the most complex step of the process. In the past I had tried using hierarchical clustering without much success, so this time around I decided to use an iterative clustering algorithm similar to Lloyd&#8217;s algorithm, in the same vein as the algorithm used in the <a href="http://research.microsoft.com/en-us/um/people/hoppe/proj/mcgim/">Multi-chart geometry images (MCGI)</a> paper.</p>
<p>Like Lloyd&#8217;s clustering algorithm, the MCGI algorithm iterates between chart growing and reseeding stages. The growth of the charts is guided by a metric based on the normal deviation and the distance between the face centroids. After each chart growing iteration a new seed is selected taking the most central face of the chart, and the process is repeated until the seed location does not change anymore.</p>
<p>My implementation of the MCGI algorithm worked moderately well, but it didn&#8217;t always produce good results. It was possible to tweak the number and location of the seeds to obtain the desired output, but that required a certain amount of user intervention that was not desired.</p>
<p>Part of the problem is that the meaning of &#8220;good&#8221; in this setting is very subjective. It usually means nicely shaped charts, that fit well to the surface, produce parameterizations with little distortion, have fairly straight and convex boundaries and are more or less equaly sized.</p>
<p>In order to adapt the algorithm to our purposes I did two things, modified the bootstraping method so that the initial number of seeds is chosen automatically and used a combination of metrics to obtain better control over the results.</p>
<p>In order to select the initial number of seeds, I simply insert the seeds one by one, and grow the respective charts until a threshold is met. At that point I pick an arbitrary face that is not assigned to any chart yet and repeat the process. When no faces are left, the growing process is restarted from all seeds in parallel.</p>
<p>A common strategy to remove the sensitivity to the initial conditions is to use the farthest point heuristic. However, instead of doing that I found that an approach that works well is to pick the worst candidate face of the already chosen charts as the next seed.</p>
<p>The second important change to the algorithm was to use a different set of metrics. The MCGI paper proposes a metric that combines normal deviation with distance between face centroids. I found that using absolute distances made the algorithm very dependent on the tessellation of the mesh and that measuring the distances from the centroids favored triangles with low aspect ratios.</p>
<p>Instead of using distance between faces I considered only the normal deviation and combined it with other metrics similar to the ones proposed in <a href="http://www.cs.ubc.ca/labs/imager/tr/2005/Vlad_DCharts/">D-Charts: Quasi-Developable Mesh Segmentation</a> and that take roundness and straightness into account.</p>
<p>These metrics also had their own problems and I had to tweak them in various ways. The most significant issue is that they constrained the chart growth in undesired ways. For example, to encourage chart convexity you would associate a high factor to the corresponding metric, but that would result in a large number of almost convex charts, as soon as a convex configuration was found no additional faces could be added to the chart. So, instead of using these metrics to constrain the growth I only use them to favor convex charts or straight boundaries; that allowed the charts to grow freely, but still retain the most convex and most straight shape possible.</p>
<p>A trick that helped in many cases was to incorporate some input from the artist, but without imposing any additional burden to them. A simple way of doing that is taking into account the existing parameterization of the mesh. Our objects already have a parameterization that is used for texturing and the artists tend to place texture seams at locations that are not easily visible. Snapping the boundaries of our charts to the existing seams did not only reduce the overall number of seams, but also caused the charts to evolve in a way that matches better what the artist would have done manually.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/03/charts02.png"><img class="aligncenter size-medium wp-image-221" src="http://the-witness.net/news/wp-content/uploads/2010/03/charts02-300x168.png" alt="" width="300" height="168" /></a></p>
<p>I considered texture and normal seams independently. Since our parameterization is used for lighting I follow normal seams more strictly and proportionally to their angle, not doing so would cause the corners to appear less defined or more blurry. That also helps the process to converge much more quickly in architectural meshes that have many hard edges.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/03/charts00.png"><img class="aligncenter size-medium wp-image-178" src="http://the-witness.net/news/wp-content/uploads/2010/03/charts00-300x168.png" alt="normal seam fitting" width="300" height="168" /></a></p>
<p>Finally, I don&#8217;t impose any chart topology constrains. I specially wanted charts go grow around holes in the mesh as long as the metric was below the desired threshold. I was tempted to use a better proxy fitting metric instead of the normal deviation metric, but that would have generated cylindrical or conical charts that would have to be cut, and I did not want to deal with that. Closing holes on the other side is fairly easy, it&#8217;s just matter of detecting the boundaries and closing all, but the longest one.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/03/charts01.png"><img class="aligncenter size-medium wp-image-179" src="http://the-witness.net/news/wp-content/uploads/2010/03/charts01-300x168.png" alt="charts with holes" width="300" height="168" /></a></p>
<h3>Parameterization</h3>
<p>For the chart parameterization algorithm we simply use <a href="http://alice.loria.fr/index.php/publications.html?Paper=lscm@2002">Least Squares Conformal Maps</a> since I had an implementation already available. My implementation is based on the description of the algorithm in the <a href="http://www.inf.usi.ch/hormann/parameterization/CourseNotes.pdf">notes</a> of the <a href="http://www.inf.usi.ch/hormann/parameterization/index.html">SIGGRAPH 2007 Mesh Parameterization course</a>, which I found much more accessible than the one in the original paper. Particularly useful is the chapter about numerical optimization, although if I had to write a sparse matrix solver again I would probably use <a href="http://alice.loria.fr/index.php/software/4-library/23-opennl.html">OpenNL</a>, since it has now been released under a liberal BSD license.</p>
<p>LSCM is not the best parameterization algorithm out there. It worked pretty well in most cases, although in some rare situations it resulted in small self-overlaps. That happened in two cases:</p>
<ul style="margin-bottom: 1em;">
<li>Zero area triangles in the input sometimes flipped in the parameterization.</li>
<li>Charts with complex boundaries that self-intersect when parameterized.</li>
</ul>
<p>The first case turned out that was caused by T-junctions in the input mesh that were detected as holes and filled with a degenerate triangle. In practice the small overlaps in the parameterization were not really an issue so instead of fixing the input we simply plan to report these problems to the artist in the exporter and have him fix the them if it turns out it&#8217;s causing artifacts.</p>
<p>In the second case, increasing the weight of the convexity metric used during the clustering process allowed us to prevent these errors. So, I didn&#8217;t really do anything to handle this problem, but so far it has not been an issue.</p>
<p>Even after that we had some problematic cases remaining. I noticed that the implementation in Blender was not having this same issues and was handling these cases more gracefully. So, I asked Brecht Van Lommel, who suggested the use of alternate matrix weights based on the ABF formulation of LSCM, and that seemed to eliminate the remaining issues.</p>
<p>While LSCM is very easy to implement, it&#8217;s definitely not the best parameterization method out there. If I were to implement something better I would probably look at <a href="http://alice.loria.fr/index.php/publications.html?Paper=LinABF@2007">LinABF</a> or <a href="http://mgarland.org/files/papers/param.pdf">Fitting to Guidance Gradient Fields</a>. However, since parameterization of the individual charts is currently the fastest step it may make sense to also look at more expensive deformation analysis methods.</p>
<h3>Packing</h3>
<p>Our packing algorithm is fairly simple. Like many other implementations we first sort the charts by parametric area, rotate them to align the charts with their best fit rectangle and greedily introduce them in the atlas one by one. Ideally I should test all 4 possible orientations, but currently I simply pick one of the orientations randomly.</p>
<p>Instead of using a tetris-like scheme to find the best location for each chart, I use a more brute force approach in which all the possible locations are considered. I achieve that using a conservative rasterizer that tags all the texels touched by a chart, plus an extra texel for padding. I progressively increase the texture extents as new charts are inserted. If the a location within the current extents is found, the chart is automatically accepted, otherwise a metric is evaluated to determine the location that least increases the extents of the atlas. Since I use a greedy algorithm, minimizing area resulted in atlases with very high aspect ratios. So, instead I minimize a metric that combines extent and perimeter and results in mostly square atlases.</p>
<p>Here are some examples of the results:</p>
<p><img class="aligncenter size-full wp-image-145" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/uploads/2010/03/packing_cottage00.png" alt="" width="448" height="452" /></p>
<p><img class="aligncenter size-full wp-image-153" style="border: 1px solid black;" src="http://the-witness.net/news/wp-content/uploads/2010/03/packing_tower00.png" alt="" width="435" height="421" /></p>
<p>Once we use lightmap compression it will probably make sense to align the charts to DXT block boundaries in order to prevent bleeding artifacts.</p>
<h3>Future Improvements</h3>
<p>This is one of the areas where I think there&#8217;s a lot of room for improvement, but at the same time, there&#8217;s not much !/$ in spending more time improving the results. Even though it has not been tested in production, I think that our current solution works fairly well. It would be nice to have larger charts with less distortion or a lower number of seams, and I would certainly have fun working on that. However, that&#8217;s not going to make the game run significantly faster or look dramatically better. We plan to release the source code of these algorithms at some point so my hope is that the implementation will progressively get better as other people adopt it and improve it to fit their needs.</p>
<p>That said, if there&#8217;s one area where I think it&#8217;s worth investing, that is in the use of signal specialized parameterizations. The research papers on the subject (<a href="http://research.microsoft.com/en-us/um/people/hoppe/proj/ssp/">Signal-specialized parametrization</a> and <a href="http://research.microsoft.com/en-us/um/people/hoppe/proj/ssplinear/">Signal-specialized parameterization for piecewise linear reconstruction</a>) are probably overkill in our setting, and I&#8217;m not sure they would work very well with our low resolution meshes.</p>
<p>Half-Life 2 achieved that that by using artist specified sampling rates for each surface, but I think it&#8217;s worth doing that automatically using an approach like <a href="http://www.bungie.net/images/Inside/publications/presentations/Lightmap_Compression_2008_02_22.pptx">the one proposed by Bungie</a>, which seems fairly simple and provides most of the gains the more complex approaches would give us.</p>
<p>My expectation is that the current implementation won&#8217;t suffer significant changes, other than small tweaks and slight adjustments to deal with problematic cases that may show up in the future. If someone has any experience with these kind of algorithms, I would love to hear about it. In particular I&#8217;d like to know if there&#8217;s anything you would have done differently, or if there&#8217;s any optimization or improvement that I may have overlooked and you think is worth considering.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=120</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Lighting Comparison</title>
		<link>http://the-witness.net/news/?p=196</link>
		<comments>http://the-witness.net/news/?p=196#comments</comments>
		<pubDate>Mon, 29 Mar 2010 06:08:20 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=196</guid>
		<description><![CDATA[It seems like time to post some images from the in-progress precoputed lighting tech that Ignacio is working on.  See here for a description of the basics behind what we are doing for lighting.  The lightmaps are now 16-bit and these shots use a simple exponential tone mapper.
First, I&#8217;ve taken shots from 3 positions inside [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like time to post some images from the in-progress precoputed lighting tech that Ignacio is working on.  See <a href="http://the-witness.net/news/?p=50">here</a> for a description of the basics behind what we are doing for lighting.  The lightmaps are now 16-bit and these shots use a simple exponential tone mapper.</p>
<p>First, I&#8217;ve taken shots from 3 positions inside a house, with four different lighting settings.  For all four settings, we are computing only the first lighting bounce.  The parameters are:</p>
<ol>
<li>32&#215;32 cube maps, adaptive sampling, quality = 0.5.  Time to compute: 197 seconds.</li>
<li>32&#215;32 cube maps, non-adaptive sampling.  Time to compute: 648 seconds.</li>
<li>64&#215;64 cube maps, non-adaptive sampling.  Time to compute: 738 seconds.</li>
<li>128&#215;128 cube maps, non-adaptive sampling.  Time to compute: 1570 seconds.</li>
</ol>
<p>(Click for full size).</p>
<p style="text-align: center;"><strong>Front Door:</strong></p>
<p style="text-align: center;"><strong> </strong><br />
<a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot1_32_b1_ay.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot1_32_b1_ay.jpg" alt="shot1_32_b1_ay" /></a></p>
<p style="text-align: center;">32&#215;32 adaptive</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot1_32_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot1_32_b1_an_sn.jpg" alt="shot1_32_b1_an_sn" /></a></p>
<p style="text-align: center;">32&#215;32</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot1_64_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot1_64_b1_an_sn.jpg" alt="shot1_64_b1_an_sn" /></a></p>
<p style="text-align: center;">64&#215;64</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot1_128_b1_ansn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot1_128_b1_ansn.jpg" alt="shot1_128_b1_ansn" /></a></p>
<p style="text-align: center;">128&#215;128</p>
<p style="text-align: center;">
<p><span id="more-196"></span></p>
<p style="text-align: center;"><strong>Corner:</strong><br />
<a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot2_32_b1_ay.jpg"></a></p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot2_32_b1_ay.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot2_32_b1_ay.jpg" alt="shot2_32_b1_ay" /></a></p>
<p style="text-align: center;">32&#215;32 adaptive</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot2_32_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot2_32_b1_an_sn.jpg" alt="shot2_32_b1_an_sn" /></a></p>
<p style="text-align: center;">32&#215;32</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot2_64_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot2_64_b1_an_sn.jpg" alt="shot2_64_b1_an_sn" /></a></p>
<p style="text-align: center;">64&#215;64</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot2_128_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot2_128_b1_an_sn.jpg" alt="shot2_128_b1_an_sn" /></a></p>
<p style="text-align: center;">128&#215;128</p>
<p style="text-align: center;">
<p style="text-align: center;"><strong>Side Wall:</strong><br />
<a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_32_b1_ay.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_32_b1_ay.jpg" alt="shot3_32_b1_ay" /></a></p>
<p style="text-align: center;">32&#215;32 adaptive</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_32_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_32_b1_an_sn.jpg" alt="shot3_32_b1_an_sn" /></a></p>
<p style="text-align: center;">32&#215;32</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_64_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_64_b1_an_sn.jpg" alt="shot3_64_b1_an_sn" /></a></p>
<p style="text-align: center;">64&#215;64</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_128_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_128_b1_an_sn.jpg" alt="shot3_128_b1_an_sn" /></a></p>
<p style="text-align: center;">128&#215;128</p>
<p style="text-align: center;">
<p>The hardware used to compute these timings is an Intel Core i7-860 with an ATI Radeon 5870 (most of the process is GPU-bound).</p>
<p>The non-adaptive sampling renders one cube map for each shadow map texel, whereas the adaptive sampling uses heuristics to place samples and then smoothes the map between them.  At higher quality settings, adaptive sampling provides more-accurate results, but there always seem to be artifacts, so for the time being we are using it as a fast preview mode.  If at some point the quality becomes shippable, then we would switch to adaptive sampling for everything.</p>
<p>We also have a sub-texel sampling mode that improves quality, but I didn&#8217;t play with that during this run.</p>
<p style="text-align: left;">This second set of images shows progressive bounces of the lighting with 64&#215;64 cube maps, non-adaptive sampling.  (The first one is the same 64&#215;64 image as above).  The times are: 1 bounce, 738 seconds; 2 bounces, 1438 seconds; 3 bounces, 2481 seconds.  The precompute time is basically linear in the number of bounces, as one might expect (the algorithm is basically just doing the same thing n times.)</p>
<p style="text-align: left;">
<a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_64_b1_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_64_b1_an_sn.jpg" alt="shot3_64_b1_an_sn" /></a></p>
<p style="text-align: center;">1 bounce</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_64_b2_an_sn.jpg"><img src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_64_b2_an_sn.jpg" alt="shot3_64_b2_an_sn" /></a></p>
<p style="text-align: center;">2 bounces</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/shot3_64_b3_an_sn.jpg"><img class="aligncenter" src="http://the-witness.net/news/wp-content/gallery/precomputed-lighting-2/thumbs/thumbs_shot3_64_b3_an_sn.jpg" alt="shot3_64_b3_an_sn" /></a></p>
<p style="text-align: center;">3 bounces</p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=196</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Shadow Maps (part 1)</title>
		<link>http://the-witness.net/news/?p=77</link>
		<comments>http://the-witness.net/news/?p=77#comments</comments>
		<pubDate>Wed, 03 Mar 2010 18:22:04 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=77</guid>
		<description><![CDATA[The Witness contains a mixture of indoor and outdoor scenes, but much of the game takes place outdoors with a very long view distance (you can see the entire island at once if you have a good vantage point).  So I wanted to implement a shadow system that would work robustly, provide high visual quality, [...]]]></description>
			<content:encoded><![CDATA[<p><em>The Witness</em> contains a mixture of indoor and outdoor scenes, but much of the game takes place outdoors with a very long view distance (you can see the entire island at once if you have a good vantage point).  So I wanted to implement a shadow system that would work robustly, provide high visual quality, and allow the player to see everything at once.  I have some experience with shadow systems of this type, but the last one I designed was for computers and graphics cards circa 2004, so I was interested to see how much more would be possible today.</p>
<p>We&#8217;ve implemented such a modern shadow map system for <em>The Witness</em>.  In the process, we&#8217;ve made some improvements to shadow mapping algorithms beyond anything we&#8217;ve seen published, so we are going to detail the improvements here.  Also, our shadow map system is still being improved, so I&#8217;ll talk about what we have yet to try and why we think it&#8217;s a good idea.</p>
<p>Before we get to those details, though, I&#8217;d like to establish some context so that the motivation for these design decisions is clearly explained.</p>
<p><strong>The Literature</strong></p>
<p>I have a somewhat cynical attitude toward graphics research literature: most of it describes techniques that don&#8217;t generally work, but the authors of the papers do the best they can to &#8220;sell&#8221; the technique to you anyway (using cherry-picked examples, glossing over or completely ignoring failure cases that would be obvious to anyone who understands the algorithm, etc).  As the reader, eventually you come to understand all the problems, but not after investing a lot of your time and energy (possibly months) implementing and understanding an algorithm that behaves so poorly that you never would have bothered if you had known the truth from the outset.</p>
<p><span id="more-77"></span></p>
<p>I&#8217;ve had this experience many times, with many different techniques.  Shadow maps, though, have been one of the big ones.  There are many published shadow map techniques that simply don&#8217;t work well enough to be taken seriously.  And often when I&#8217;ve heard someone say &#8220;so-and-so shadow technique is good,&#8221; it usually turns out they haven&#8217;t tried it themselves, so it&#8217;s just hearsay, or else that person has low quality standards.</p>
<p>So I&#8217;d like to put forth the statement that I have high quality standards and will only endorse things that have been found to robustly function; I will be open and honest about the degree to which things don&#8217;t work, and what the specific problems are.  In an ideal world this would not be necessary to say, but the situation in the literature today makes it otherwise.</p>
<p><strong>Quality Goals; Previous System</strong></p>
<p>Many shadow map schemes have been developed that try to maximize the effective resolution of shadows in the scene by performing transformations that are heavily view-dependent.  An extreme example of this is Perspective Shadow Maps.  I have learned through experience not to use these techniques.  They cause shadows to swim and flicker in annoying ways, and many of the algorithms break down severely as the player approaches certain viewing angles.</p>
<p>For <a href="http://www.number-none.com/happycake/notes_8/index.html">the 2004 system</a>, I took as a core design goal that shadows should appear rock-solid on nonmoving objects, regardless of any viewpoint motion.  The clearest way to achieve this was to center the shadow map on the viewpoint at all times, never letting the shadow map scale or rotate.  Because a single shadow map cannot cover the world at high resolution within memory and fill constraints, I used a scheme where 4 or more shadow maps of increasing worldspace size were centered on the viewpoint like square doughnuts.  In order to prevent crawling or shimmering, one just ensures that shadow map worldspace positions are snapped to integer multiples of their texel size.  (A family of related techniques, but which don&#8217;t necessarily center the maps on the viewpoint, soon came into more-common use and took on the moniker Cascaded Shadow Maps.)</p>
<p>On fixed-function pipeline hardware, this scheme was never quite satisfying (I had to use clip planes to render the scene in many slices, and there were small 1-pixel artifacts due to the resulting imprecision; rendering all the slices was a bit slow).  Modern hardware is able to do this kind of thing much  better.  Also, this scheme wastes a large amount of shadow map memory, because with all the shadow maps centered on the viewpoint, most of the map texels are going to be out of view at any given time.</p>
<p>Despite the drawbacks, the visual stability of this technique, and its ability to reach across the entire game world, were extremely appealing to me.  Having seen how nicely shadow mapping could behave in practice, this visual stability became a very-high-priority goal in my mind for any future shadow systems.</p>
<p>So, going into this new system, the goals were (listed in approximate order of importance):</p>
<ol>
<li>High performance</li>
<li>Complete stability under camera motion</li>
<li>Long view distance</li>
<li>Visuals can be controlled to suit the style of the game</li>
<li>Efficient use of texture memory</li>
</ol>
<p><strong>The New System</strong></p>
<p>I started working on the new system by looking at the 2004 system and trying to make it more memory-efficient.  Most likely this would involve moving the shadow maps around in world space, but it wasn&#8217;t initially clear to me how to do this without introducing problems.  Ignacio pointed me at Michal Valient&#8217;s article &#8220;Stable Rendering of Cascaded Shadow Maps&#8221; in <a href="http://www.shaderx6.com/">ShaderX 6</a>, which was exactly what I wanted.  Valient computes bounding spheres around the slices of the view frustum that tell him how much he can move the shadow maps in world space without introducing gaps.</p>
<p>To illustrate, here are a couple of figures reproduced from his article.  I don&#8217;t want to unduly step on anyone&#8217;s copyright, so if you are interested in cutting-edge shadow map techniques, buy ShaderX 6!  <em>(Click for full size.)</em></p>
<p style="text-align: center;"><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/valient-shaderx6-figures/figure_411.png"><img class="ngg-singlepic ngg-center aligncenter" src="http://the-witness.net/news/wp-content/gallery/valient-shaderx6-figures/thumbs/thumbs_figure_411.png" alt="figure_411" /></a></p>
<p style="text-align: center;"><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/valient-shaderx6-figures/figure_412.png"><img class="ngg-singlepic ngg-center aligncenter" src="http://the-witness.net/news/wp-content/gallery/valient-shaderx6-figures/thumbs/thumbs_figure_412.png" alt="figure_412" /></a></p>
<p style="text-align: left;">So basically, you take the a frustum slice in worldspace, ensure that it is completely enclosed in a sphere, and then ensure that the sphere is completely enclosed in a square cylinder; the square is your shadow map.</p>
<p style="text-align: left;">You can render multiple frustum slices for multiple shadow maps, so long as the bounding spheres overlap enough to cover the whole frustum when put together (see 4.1.2 c and d).</p>
<p style="text-align: left;">The reason they are spheres is: because the shadow map is never allowed to change size (we voluntarily imposed that constraint in order to get solid shadows!), then we need to find a shape that conservatively encloses any possible orientation that a frustum slice could occupy as the camera rotates in space.  That&#8217;s a sphere.  Then we make sure that our shadow map covers that entire sphere, and we have then guaranteed that every point in the view frustum is covered by a valid shadow map  texel.</p>
<p style="text-align: left;">On top of this, Valient suggests the very helpful optimization of packing all your shadow maps into one atlas texture, so that when it&#8217;s time to render the scene, you can draw all your shadowed objects in one pass without having to sample multiple textures; you just figure out which frustum slice each pixel lands in, then use that information to determine the offset into the atlas, add that offset to your texture coordinates, and sample the texture.  This works great.  Valient suggests a 2&#215;2 arrangement of textures, as this is convenient on a wide variety of hardware, for example, GPUs that only support power-of-two textures.  So if a single shadow map would be 1024&#215;1024, then you can create a 2048&#215;2048 texture map that contains 4 shadow maps packed in a 2&#215;2 array:</p>
<p style="text-align: left;"><a href="http://the-witness.net/news/wp-content/uploads/2010/03/4maps.png"><img class="aligncenter size-medium wp-image-92" title="4maps" src="http://the-witness.net/news/wp-content/uploads/2010/03/4maps-251x300.png" alt="" width="251" height="300" /></a></p>
<p style="text-align: left;">So my first shot at a new system was basically a reimplementation of everything Valient describes.  It didn&#8217;t take too long, and when it was done, I was very happy with it &#8212; it was clearly much better than the 2004 system.</p>
<p style="text-align: left;">But&#8230;</p>
<p style="text-align: left;"><strong>Memory Usage</strong></p>
<p style="text-align: left;">This technique is still a memory hog.  The image stability constraints, which result in us wrapping the frustum slice in a sphere and then the sphere in a box, add margins of unused and barely-used texture space at each step.  Looking at Figure 4.1.2, you can see that a frustum slice only occupies about 50% or 60% of the area of the square that represents your shadow texture.  This implies that half the square is wasted.  <strong>However, the actual situation is worse than this, because the diagram is misleading.</strong></p>
<p style="text-align: left;">The problem is that the view frustum represented in the diagram is much narrower than the view frustum used in an actual game, and if you re-draw the diagram in realistic proportions, it looks very different.  For an accurate 2D diagram, you are finding a circle that encloses the widest part of your view frustum, which is the 2D trapezoid you get by cutting your frustum in half diagonally (Valient discusses this in his paper as well).  Suppose your game is rendering at a 16:9 aspect ratio, and your field of view is 90 degrees horizontally (this is what we use for <em>The Witness </em>currently.)  The vertical field of view is then going to be about 59 degrees, and the diagonal field of view will be about <strong>98 degrees</strong> (click on image below for explanation).</p>
<p style="text-align: left;"><a href="http://the-witness.net/news/wp-content/uploads/2010/03/diagonal_fov.png"><img class="aligncenter size-medium wp-image-89" title="diagonal_fov" src="http://the-witness.net/news/wp-content/uploads/2010/03/diagonal_fov-300x213.png" alt="" width="300" height="213" /></a></p>
<p style="text-align: left;">The frustum slice in Valient&#8217;s diagram is only about 30 degrees, a huge difference!  So if we have a 98 degree frustum slice, and inscribe that in a circle, and inscribe that circle in a square, what does that look like?  Something like this:</p>
<p style="text-align: center;"><img class="aligncenter" title="1slice" src="http://the-witness.net/news/wp-content/uploads/2010/03/1slice-300x295.png" alt="" width="300" height="295" /></p>
<p style="text-align: left;">Recall that the square is your shadow map texture and the innermost trapezoid is your frustum slice (the texels of your texture that may potentially be used).  It covers only a small  area of that square &#8212; and there&#8217;s no way to make it bigger!  The reason is that for wide frusta like this, the diagonal at the far plane is so long that it dominates the bounding sphere computation, and so the center of the circle has to land on that diagonal so that its diameter can be just barely large enough to enclose it.  (In <em>The Witness</em>, our frustum slices are not proportional, and the way we divided them up, this isn&#8217;t exactly true for the first 2 shadow maps &#8212; but it is very close to true).  The fact that the circle is centered on the far plane means that automatically half the map is wasted at this orientation &#8212; but the wide angle ensures that much of the other half is wasted too!</p>
<p style="text-align: left;">You can rotate the view frustum to other orientations and make it look like you are covering more of the shadow map&#8230; for example, if you orient the frustum so that the view vector is going straight down into the page, then the frustum&#8217;s projection onto the paper will be a rectangle, and it will appear to cover much more of the square.  But then you have to keep in mind that some of this coverage is worth a lot more than other coverage in terms of impact on the scene: think about how much space is covered by the texels toward the middle of the frustum projection, versus how much is covered toward the edges (almost none!)</p>
<p style="text-align: left;">If I add two more frustum slices, so that the total is 3 slices as in 4.1.2, it looks like this:</p>
<p style="text-align: left;"><a href="http://the-witness.net/news/wp-content/uploads/2010/03/1slice.png"></a><a href="http://the-witness.net/news/wp-content/uploads/2010/03/3slices.png"><img class="aligncenter size-medium wp-image-101" title="3slices" src="http://the-witness.net/news/wp-content/uploads/2010/03/3slices-300x295.png" alt="" width="300" height="295" /></a></p>
<p style="text-align: left;">That innermost shadow map is just a tiny smudge (now you know why Valient chose a narrow field of view &#8212; for clarity of his figures!)  But notice what else is going on: each shadow map is fully contained within the next-larger shadow map, as with the concentric-square-doughnut system from 2004!  Valient&#8217;s scheme is better since it gives you more view distance (the squares are not concentric) &#8212; but it can&#8217;t give you nearly as much view distance as it would like, due to the wide angle of the frustum.</p>
<p style="text-align: left;"><strong>For Next Time</strong></p>
<p style="text-align: left;">So, whereas on one level I was very happy with this shadow system&#8217;s performance and visual quality, it still seemed somewhat wasteful in terms of memory usage.   Next time I&#8217;ll talk about how we addressed that problem.  Subsequent postings after that will talk about issues like softening the shadow border, blending between slices, and various other implementation tricks.</p>
<p style="text-align: left;"><strong><br />
</strong></p>
<p style="text-align: left;"><strong>To be continued.</strong></p>
<div><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><br />
</span></div>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=77</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Announcing Indie Fund</title>
		<link>http://the-witness.net/news/?p=80</link>
		<comments>http://the-witness.net/news/?p=80#comments</comments>
		<pubDate>Tue, 02 Mar 2010 20:34:18 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=80</guid>
		<description><![CDATA[
Today we are announcing a fund that provides very good terms for talented indie developers working on high-quality games.  Our terms are much friendlier than what publishers offer.  Our goal is to help indies become stronger while retaining their independence.
The past couple of years have been good for independent game developers.  Through download services like [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://the-witness.net/news/wp-content/uploads/2010/03/indiefund2.png"><img class="aligncenter size-full wp-image-84" title="indiefund2" src="http://the-witness.net/news/wp-content/uploads/2010/03/indiefund2.png" alt="" width="194" height="124" /></a></p>
<p>Today we are announcing a fund that provides very good terms for talented indie developers working on high-quality games.  Our terms are much friendlier than what publishers offer.  Our goal is to help indies become stronger while retaining their independence.</p>
<p>The past couple of years have been good for independent game developers.  Through download services like Xbox Live Arcade, the PlayStation Network, WiiWare, and Steam, independent developers have found a very large audience.  Some of us have been lucky enough to develop hit indie games that were very financially successful.</p>
<p><em>Braid</em> was one of those games.  The success of <em>Braid</em> has allowed me to undertake more-ambitious projects like <em>The Witness</em>.  At the same time, I felt that I wanted to do something with the profits that would help other indies with their own games.  More recently, while talking to publishers about <em>The Witness</em>, I felt that the business climate around publishing and funding these smaller games had not caught up with reality: it&#8217;s a model where the standard terms are tuned for budgets in the tens of millions of dollars.  Because publishers want to stick to this model even for low-budget games, it was very hard for indie developers to get a fair deal.</p>
<p>It turns out that other successful indies felt the same way, so we have pooled our resources and launched this fund.  We will be announcing further details soon.  At the GDC, <a href="http://www.cmpevents.com/GD10/a.asp?option=C&amp;V=11&amp;SessID=10601">Ron Carmel will be giving a talk</a> about the problems that exist in the current publishing model for indie-budget games.</p>
<p>We&#8217;ve had the timing of this announcement planned for a while, but it seems like some kind of strange synchronicity that we&#8217;re revealing our existence <a href="http://ps3.ign.com/articles/107/1073304p1.html">just as all this trouble is happening at Infinity Ward</a>.  When you&#8217;re a mainstream developer, and you&#8217;ve made <strong>one of the most successful and profitable games of all time</strong>, and then just a few months later your publisher and parent company is willing to so bald-facedly mutilate your company, well, what conclusions can be drawn from that?  If publishers of that size are so megalomaniacal as to be incapable of seeing the importance of a developer&#8217;s talent &#8212; instead believing that the game&#8217;s success is somehow due primarily to their brilliant marketing strategy or their CEO&#8217;s charming personality &#8212; then how will this ever change?</p>
<p>If Infinity Ward can&#8217;t be treated with respect, then who can?</p>
<p>Independent developers can.  That&#8217;s one answer, at least.  Indie Fund is here to help make that independent existence a reality for as many talented developers as we can.</p>
<p><a href="http://indie-fund.com/">Here&#8217;s a link to the main Indie Fund site</a>, with an email you can use to contact us.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=80</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Twitter and Facebook pages are now live.</title>
		<link>http://the-witness.net/news/?p=71</link>
		<comments>http://the-witness.net/news/?p=71#comments</comments>
		<pubDate>Tue, 02 Mar 2010 07:37:17 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=71</guid>
		<description><![CDATA[You can now be notified of new blog postings via RSS, Twitter or Facebook.  See the icons in the upper-right corner!
At the moment of writing this post, The Witness has no Twitter followers and no Facebook fans, so you could be the first!
]]></description>
			<content:encoded><![CDATA[<p>You can now be notified of new blog postings via RSS, Twitter or Facebook.  See the icons in the upper-right corner!</p>
<p>At the moment of writing this post, <em>The Witness</em> has no Twitter followers and no Facebook fans, so <em>you could be the first!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=71</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Precomputed Lighting</title>
		<link>http://the-witness.net/news/?p=50</link>
		<comments>http://the-witness.net/news/?p=50#comments</comments>
		<pubDate>Mon, 01 Mar 2010 00:40:45 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=50</guid>
		<description><![CDATA[For the past 15 years or so, graphics technology in games has been driven by shooters.  Most shooters generate visual interest in their scenes by having lots of dynamic lights, with extreme use of bump mapping, and moving shadows, and particle effects.
For The Witness, I wanted to develop a graphical style that values simplicity.   [...]]]></description>
			<content:encoded><![CDATA[<p>For the past 15 years or so, graphics technology in games has been driven by shooters.  Most shooters generate visual interest in their scenes by having lots of dynamic lights, with extreme use of bump mapping, and moving shadows, and particle effects.</p>
<p>For <em>The Witness</em>, I wanted to develop a graphical style that values simplicity.   It would be suited to mellower environments, with both indoor and outdoor settings.  Some kind of global illumination solution seemed like the right idea here.  (Global illumination is when you simulate light bouncing around in a scene; the resulting look is usually much richer and subtler than the direct lighting that games usually do.)</p>
<p>Clearly, full real-time global illumination would be the most versatile solution.  I investigated some licensable packages that provide this, such as <a href="http://geomerics.com/">Geomerics&#8217; SDK</a>.  However, these solutions will invariably use a lot of texture space, and consume a bunch of processing time, and they seem like overkill for this game (<em>The Witness</em> does not have many moving light sources, relative to other types of games).</p>
<p>So, some form of precomputed global illumination seemed like the right thing.  3D modeling packages have plugins to compute global illumination, but they are very difficult to interface with, and they could not even come close to handling a full game scene.   The only thing that knows where all the objects in the world are at once is the game itself (and the in-game editor), so it seemed appropriate to develop our own in-game system for global illumination.  It could have been radiosity, could have been something like Monte Carlo Path Tracing, but <a href="http://www.cbloom.com/">Charles Bloom</a> suggested the very simple solution of just rendering the scene for every pixel in a lightmap, and that seemed like a good idea.  With an approach like that, you don&#8217;t have to do a bunch of monkeying around to make radiosity or ray tracing match the completely different algorithm that is used to render your realtime game scene; light transport is computed by that same algorithm, so it will automatically match unless you mess things up.</p>
<p>For several months, <a href="http://castano.ludicon.com/blog/">Ignacio Castaño</a> has been working on this system.  He is writing up a highly technical explanation of how the system works, which I think he&#8217;ll be done with in a few days, but in the meantime, here is a lighter-weight overview.<br />
<span id="more-50"></span></p>
<p>At preprocess time, we just walk a camera over every surface, pointing the camera away from the surface and rendering the game scene into a hemicube in video memory.  The render target textures of a hemicube are packed together into an atlas, and when the atlas fills up, we download it into system memory, integrate the values in each hemicube to find an average light value, and then store that value in the lightmap.  Most of the shots below were generated using 128&#215;128 cube maps and multiple samples per texel.</p>
<p>Because we are just using our regular rendering code, this precomputation process is hardware-accelerated by default.</p>
<p>Note: <em>In the images below, all geometry and textures are placeholders. </em> As with Braid, we are using rough-draft versions of all these things while the core gameplay is built.  Bloggers, <strong><em>these are not to be considered screenshots of the game</em></strong>.  They aren&#8217;t supposed to look good yet &#8212; they are just supposed to show the precomputed lighting.</p>
<p>First, some shots of the house.  The precomputed lighting is responsible for most of the light in the room.  The places where you see sunlight hitting surfaces directly are dynamic; everything else is a static precompute.  (Without the precomputed lighting, the entire room would be black except for the patches of sunlight).</p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/house1.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_house1.jpg" alt="house1" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/house2.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_house2.jpg" alt="house2" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/house3.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_house3.jpg" alt="house3" /></a></p>
<p>Note the ambient occlusion, soft shadows, and other nice effects that all come naturally from this system.  (In the third image, the picture on the wall hasn&#8217;t been lightmapped yet, which is why it sticks out so brightly.)</p>
<p>Here&#8217;s a simple bunker interior consisting mostly of a single material and color.</p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/bunker1.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_bunker1.jpg" alt="bunker1" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/bunker2.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_bunker2.jpg" alt="bunker2" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/bunker3.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_bunker3.jpg" alt="bunker3" /></a></p>
<p>Lastly, the tower:</p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/tower1.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_tower1.jpg" alt="tower1" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/tower2.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_tower2.jpg" alt="tower2" /></a></p>
<p><a class="shutterset_" href="http://the-witness.net/news/wp-content/gallery/lighting/tower3.jpg"><img class="ngg-singlepic ngg-center" src="http://the-witness.net/news/wp-content/gallery/lighting/thumbs/thumbs_tower3.jpg" alt="tower3" /></a></p>
<p>There are lots of caveats on these images.  The game renders in HDR, but we haven&#8217;t balanced our lighting constants or done tone mapping yet, so I have gamma-corrected the output images by various amounts.  For now, we are computing only the first lighting bounce.  We&#8217;ll probably do at least 2 or 3 bounces for the final game, and when we have that running I&#8217;ll post some comparison images.  I believe our model of sky illumination is still overly simple and wrong (though I&#8217;d need to check with Ignacio on that, maybe he has fixed it up).  I haven&#8217;t played around with the results of the current system in outdoor areas (e.g. lots of small branches and leaves), though if we find that we have too many aliasing problems, we can always make the lightmaps higher-resolution in those areas.</p>
<p>In areas that have doors or windows that open and close, we are planning on layering a supplemental lightmap that gets scaled by the openness of that light aperture, then added to the base lightmap.  This will provide a pretty good approximation for the way the indirect light in the room changes as the aperture opens and closes.  Direct light will be completely correct since it uses the fully dynamic shadow system.  I&#8217;ll do a post about that shadow system sometime in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=50</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Concept Art</title>
		<link>http://the-witness.net/news/?p=9</link>
		<comments>http://the-witness.net/news/?p=9#comments</comments>
		<pubDate>Sun, 28 Feb 2010 05:58:18 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=9</guid>
		<description><![CDATA[In order to begin discussing the game, it seemed more appropriate to show some concept art, because the game is very visual.
Click for full-sized versions.  The gallery seems to hang some versions of Google Chrome.  Sorry about that.  It works fine in Firefox and Internet Explorer.
These concepts (and many more) were all done by Eric [...]]]></description>
			<content:encoded><![CDATA[<p>In order to begin discussing the game, it seemed more appropriate to show some concept art, because the game is very visual.</p>
<p><em>Click for full-sized versions.  The gallery seems to hang some versions of Google Chrome.  Sorry about that.  It works fine in Firefox and Internet Explorer.</em></p>

<div class="ngg-galleryoverview" id="ngg-gallery-2-9">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-17" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/tw_spawnpoint1.jpg" title="One of the first things you see in the game.  Who are you?  Why are you in a dark hallway?  What is that glowing panel thing?" class="shutterset_set_2" >
								<img title="tw_spawnpoint1" alt="tw_spawnpoint1" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_tw_spawnpoint1.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-15" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/tw_house_interior_3.jpg" title="The house you find yourself in." class="shutterset_set_2" >
								<img title="tw_house_interior_3" alt="tw_house_interior_3" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_tw_house_interior_3.jpg" width="340" height="191" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-13" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/color_palette_progress1.jpg" title="The house, and its grounds, surrounded by a force field, which is defending it from ... what?" class="shutterset_set_2" >
								<img title="color_palette_progress1" alt="color_palette_progress1" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_color_palette_progress1.jpg" width="340" height="186" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-19" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/windmill.jpg" title="A windmill by a lake." class="shutterset_set_2" >
								<img title="windmill" alt="windmill" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_windmill.jpg" width="340" height="192" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-16" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/tw_sculpors_studio_v02_color.jpg" title="A sculptor's studio.  Who made these?  Where did he go?" class="shutterset_set_2" >
								<img title="tw_sculpors_studio_v02_color" alt="tw_sculpors_studio_v02_color" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_tw_sculpors_studio_v02_color.jpg" width="340" height="249" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-18" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/tw_turret_interior1.jpg" title="The bottom of a tower.  Lots of steps to the top..." class="shutterset_set_2" >
								<img title="tw_turret_interior1" alt="tw_turret_interior1" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_tw_turret_interior1.jpg" width="340" height="223" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-14" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://the-witness.net/news/wp-content/gallery/concepts-1/tw_color_palette.jpg" title="A color key (still in progress) we are using as an artist guideline." class="shutterset_set_2" >
								<img title="tw_color_palette" alt="tw_color_palette" src="http://the-witness.net/news/wp-content/gallery/concepts-1/thumbs/thumbs_tw_color_palette.jpg" width="340" height="260" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p>These concepts (and many more) were all done by <a href="http://www.ericsart.com/">Eric Urquhart</a>, who has been working on the game for some months now.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=9</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Welcome to the development blog for The Witness.</title>
		<link>http://the-witness.net/news/?p=4</link>
		<comments>http://the-witness.net/news/?p=4#comments</comments>
		<pubDate>Sun, 28 Feb 2010 04:06:16 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=4</guid>
		<description><![CDATA[The Witness is a game in development, designed and produced by Jonathan Blow, designer of the critically-acclaimed game Braid.  There&#8217;s a small team working on the game, and over time this blog will introduce you to them and provide a bit more insight into the development process.
Many people have been asking for more details about [...]]]></description>
			<content:encoded><![CDATA[<p><em>The Witness </em>is a game in development, designed and produced by Jonathan Blow, designer of the critically-acclaimed game <em><a title="Braid web site" href="http://braid-game.com" target="_blank">Braid</a></em>.  There&#8217;s a small team working on the game, and over time this blog will introduce you to them and provide a bit more insight into the development process.</p>
<p>Many people have been asking for more details about the game, so I thought it might be nice to kick things off with some concept art&#8230; in the next post.</p>
<p>Welcome, and thanks for your time and attention!</p>
<p>-Jonathan.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/?feed=rss2&amp;p=4</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
