<?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/" 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>Sat, 12 May 2012 01:56:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Peter Thiel on Secrets</title>
		<link>http://the-witness.net/news/2012/05/peter-thiel-on-secrets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=peter-thiel-on-secrets</link>
		<comments>http://the-witness.net/news/2012/05/peter-thiel-on-secrets/#comments</comments>
		<pubDate>Sat, 12 May 2012 01:56:11 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1632</guid>
		<description><![CDATA[Peter Thiel is teaching a class at Stanford about how to start a technology company. One of the students is posting thorough class notes online. In this instalment, Thiel takes the question of what kind of company to start and reframes it in terms of secrets. Thiel&#8217;s point of view reminds me of the way [...]]]></description>
			<content:encoded><![CDATA[<p>Peter Thiel is teaching a class at Stanford about how to start a technology company.  One of the students is posting thorough class notes online.</p>
<p><a href="http://blakemasters.tumblr.com/post/22866240816/peter-thiels-cs183-startup-class-11-notes-essay">In this instalment</a>, Thiel takes the question of what kind of company to start and reframes it in terms of secrets.  </p>
<p>Thiel&#8217;s point of view reminds me of the way I think about games in general.  Quite often I go out and give speeches about game design or business, and I say things that some think are overly idealistic, or oblivious to the necessities of recipients&#8217; situations, or just plain wrong.  Certainly my advice usually runs counter to conventional wisdom.  (Yet somehow, by following these principles, I seem to do okay.)</p>
<p>Thiel begins with the question: &#8220;What important truth do very few people agree with you on?&#8221; and goes on to define secrets, in this context, as &#8220;unpopular or unconventional truths&#8221;.  If everyone knew these things and believed them, they wouldn&#8217;t be secrets.</p>
<p>I recommend this write-up to anyone who wants to think unconventionally about game design.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/05/peter-thiel-on-secrets/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Island Update</title>
		<link>http://the-witness.net/news/2012/04/island-update-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-update-3</link>
		<comments>http://the-witness.net/news/2012/04/island-update-3/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 19:37:51 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1622</guid>
		<description><![CDATA[We&#8217;ve done a first pass at changing the shape of the island terrain, and here&#8217;s the result: The changes are a little bit drastic in some spots, but overall not as drastic as I had expected. I had been worried about some issues in the natural flow of where players would naturally end up going, [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve done a first pass at changing the shape of the island terrain, and here&#8217;s the result:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.24__time_18_01_n08.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.24__time_18_01_n08-512x288.png" alt="" title="shot_2012.04.24__time_18_01_n08" width="512" height="288" class="aligncenter size-large wp-image-1623" /></a></p>
<p>The changes are a little bit drastic in some spots, but overall not as drastic as I had expected.  I had been worried about some issues in the natural flow of where players would naturally end up going, especially early in the game.  It turns out we were able to solve these without changing too much.  So between last island update and this one, for the most part, some areas were moved laterally or expanded, and some new elevation changes were introduced, but areas were not shuffled around; they are all more-or-less in the same place with relation to each other.  So for the most part, things are converging, which is a good sign.</p>
<p>And, oh yeah, we are making that mountain a lot bigger.  It is the messiest part of the island right now, and has been for a while.  There are still a few things gameplay-wise to figure out here, then it will start to come together. My biggest questions in the area have to do with that white building near the bottom of the image; the puzzles inside that building will determine its overall structure, which will determine how it is worked into the surrounding terrain of the mountain.  We have some proposals from the architects on what this building will look like, but it is waiting on me to finish the puzzle design.  </p>
<p>Because we haven&#8217;t done it in a while, here&#8217;s the island from a different angle:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.24__time_18_02_n09.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.24__time_18_02_n09-512x288.png" alt="" title="shot_2012.04.24__time_18_02_n09" width="512" height="288" class="aligncenter size-large wp-image-1624" /></a></p>
<p>The current puzzle count for the whole game is 450.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/04/island-update-3/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Panel Art Update</title>
		<link>http://the-witness.net/news/2012/04/panel-art-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=panel-art-update</link>
		<comments>http://the-witness.net/news/2012/04/panel-art-update/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 20:51:00 +0000</pubDate>
		<dc:creator>Luis Antonio</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Art]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1583</guid>
		<description><![CDATA[It’s now been over 5 months since I joined The Witness team as an artist and I would like to share a bit of my experience on the project coming from a “big studio” as well as the most recent work I’ve done. Just before I left my last job I was working as a [...]]]></description>
			<content:encoded><![CDATA[<p dir="ltr">It’s now been over 5 months since I joined The Witness team as an artist and I would like to share a bit of my experience on the project coming from a “big studio” as well as the most recent work I’ve done.</p>
<p dir="ltr">Just before I left my last job I was working as a Lead/Art Director on a marketing driven project focused on selling as many units as possible. On one side I had high level decisions being made by stockholders whose focus is on turning a profit while on the other side there was the development team who truly believed they would be able to make a good game.</p>
<p dir="ltr">Also I was surrounded by schedules, performance reviews, hierarchical titles, producers, human resources, bonus system and all the other corporate systems that eventually dilute the organic process of doing something creative. While I understand the logic behind it I  realized that is not the reason why I joined the video games industry and that something wasn’t right.</p>
<p dir="ltr">Now, after these few months, the answers for these questions became clear. Its all based on trust. In this project, all the decisions we arrive at are very organic. Jonathan has a very clear vision of what he wants and the fact that we can see it and believe in it makes it extremely logical and simple.</p>
<p dir="ltr">Our passion for what we do (and what we would probably be doing on our free time if we weren’t being paid for it) gets distilled directly into the game in a very rewarding process.How much and how we give it depends entirely on us and that creates a natural challenge and pressure that most AAA companies cannot provide.</p>
<p dir="ltr">This trust leads to respect and it creates a very unique work environment. This is something that I’ve never seen with all the project management, task scheduling and scrum meetings that try to fix an inherently broken game. I don’t think video games can be produced like an assembly line, at least not games that have something meaningful to say, and I’m glad that I found people that are doing it the right way.</p>
<p dir="ltr">All this may sound trivial but probably 90% of the game developers that I know will understand how big of an issue this is. I still believe big companies can change their ways and make the same profit if not more, but it has to start from the bottom, the people who are hard at work making the games.</p>
<p dir="ltr">As for the second part, I would like to share what we have been trying to do with the many island panels. As you might already know the player has to solve different puzzles using these panel interfaces scattered around the island.</p>
<p dir="ltr">I started my research by looking at what materials they could be made of, what technology they would use and how they would be assembled and how all this could relate with the different areas and narrative of the game.</p>
<p>This first set of images shows some proposals of how the panel screens could possibly look. I tried not to focus so much on the gameplay but more on ideas that could lead to further discussions among the team.</p>
<p style="text-align: center" dir="ltr"><a href="http://the-witness.net/news/wp-content/uploads/2012/04/Panel_-Concepts.jpg"><img class="aligncenter size-large wp-image-1584" src="http://the-witness.net/news/wp-content/uploads/2012/04/Panel_-Concepts-384x384.jpg" alt="" width="384" height="384" /></a></p>
<p dir="ltr">After some solid feedback and a couple of art meetings I was able to understand what was working or not and decided to do a new set of proposals. Also this time I tried to focus on the more technical aspect of getting these panels to work in the game and if the effort we would have to put into them would be worthwhile.</p>
<p style="text-align: center" dir="ltr"><a href="http://the-witness.net/news/wp-content/uploads/2012/04/Panel_-Screens02.jpg"><img class="size-medium wp-image-1585 aligncenter" src="http://the-witness.net/news/wp-content/uploads/2012/04/Panel_-Screens02-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p dir="ltr">The same amount of work went into the structure of the panels and how they would be assembled. This time, working with the architects gave valuable input into understanding how they would actually be built in the environment and the amount of work required. On this image you can see a screen capture of several prototypes before being tested ingame.</p>
<p style="text-align: center" dir="ltr"><a href="http://the-witness.net/news/wp-content/uploads/2012/04/Structure_Concept.jpg"><img class="aligncenter size-large wp-image-1586" src="http://the-witness.net/news/wp-content/uploads/2012/04/Structure_Concept-512x286.jpg" alt="" width="512" height="286" /></a></p>
<p dir="ltr">These are usually modelled very fast with just base colors so I can do several iterations until I find something that I&#8217;m happy with.<br />
And finally here is how some of them are looking in-game. They are still in concept but by placing them in the correct context makes it a lot easier to understand what is working or not.</p>
<p style="text-align: center" dir="ltr"><a href="http://the-witness.net/news/wp-content/uploads/2012/04/Structure_Ingame2.jpg"><img class="size-medium wp-image-1587 aligncenter" src="http://the-witness.net/news/wp-content/uploads/2012/04/Structure_Ingame2-177x300.jpg" alt="" width="177" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/04/panel-art-update/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Island Update</title>
		<link>http://the-witness.net/news/2012/04/island-update-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-update-2</link>
		<comments>http://the-witness.net/news/2012/04/island-update-2/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 16:40:55 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1569</guid>
		<description><![CDATA[Here&#8217;s how the island is looking right now: But today we are going to have the first in a series of meetings wherein we think pretty hard about the topography of the island and what the flow of natural curious investigation will tend to be from various spots. Expect the island to look pretty different [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how the island is looking right now:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.10__time_09_00_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.10__time_09_00_n01-512x288.png" alt="" title="shot_2012.04.10__time_09_00_n01" width="512" height="288" class="aligncenter size-large wp-image-1570" /></a></p>
<p>But today we are going to have the first in a series of meetings wherein we think pretty hard about the topography of the island and what the flow of natural curious investigation will tend to be from various spots.  Expect the island to look pretty different in the next update!  (Or maybe it will turn out that things are mostly fine&#8230;)</p>
<p>Lately, I have been working on some of the more sophisticated puzzles in the game.  These are things that were at least sort-of done already, but I wanted to revise the designs to improve them &#8212; to ensure that the puzzles are as interesting as possible and built as closely as possible around the core themes of the areas that contain them.  I am happy with the way these are coming along so far, but there is definitely still some work to do here.</p>
<p>The art team has been working further to nail down the style of the game, now focusing on cliffs and plants and other natural things, as well as control panels and other bits of machinery.  We&#8217;re also taking a few buildings that the architects have finished designing, and starting to build out the geometry as one really would for a video game.  (The architects give us buildings modeled in SketchUp, and they tend to come into the game a bit messy, but also, not modeled the way an experienced video game modeler would do it).</p>
<p>On the programming side, we&#8217;ve got lots done lately.  Andy has added a software occlusion culling system, which should help with frame rates in the game.  He&#8217;s also been playing with culling for water reflections.  Salvador got animations working in the exporter and in the game, so now we can play animations on entities, which is very useful.  (We worked on the game for years and built something fully playable without this ability!)  I have been going back and doing the gameplay work for animated entities, as some things have to change in the gameplay logic.  In all it is a very nice improvement.  Salvador is now working on asset streaming, which will help the game start up faster and run better (and help it run at all on lower-end platforms like the iPad).  Ignacio&#8217;s been doing a whole lot of fixes to various systems and hammering away at the todo list.  One of these things has been better control for the tone mapping process.  We now get a graph of tone mapping curve: </p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.10__time_09_38_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/04/shot_2012.04.10__time_09_38_n01-512x288.png" alt="" title="shot_2012.04.10__time_09_38_n01" width="512" height="288" class="aligncenter size-large wp-image-1571" /></a></p>
<p>And we also get the ability to export screenshots into Photoshop that have a color key on them; then the colors can be tweaked in Photoshop and re-imported into the game to alter tone mapper settings.  This is in many cases more convenient than playing with those sliders.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/04/island-update-2/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Post-GDC update</title>
		<link>http://the-witness.net/news/2012/03/post-gdc-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=post-gdc-update</link>
		<comments>http://the-witness.net/news/2012/03/post-gdc-update/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 22:33:46 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1563</guid>
		<description><![CDATA[We brought The Witness to the Game Developers Conference and had the game playable privately in a hotel room to select members of the press. We had to do a lot of work to get the game back into playable condition; a lot of things had been broken since the press tour last August / [...]]]></description>
			<content:encoded><![CDATA[<p>We brought The Witness to the Game Developers Conference and had the game playable privately in a hotel room to select members of the press.</p>
<p>We had to do a lot of work to get the game back into playable condition; a lot of things had been broken since the press tour last August / September.  (When you are making sweeping changes to a big and complicated game world, it is pretty easy for things to get bent out of shape).  So the GDC served as a good internal deadline to have the game banged back into shape.</p>
<p>I didn&#8217;t expect a lot of press coverage to come out of this, because at the GDC there&#8217;s just a lot of stuff going on, a lot of things for people to pay attention to and write about.  So I had been doing this mostly as an opportunity to keep the press up-to-date with the game, see how it is evolving graphically, etc.  But, to my surprise, we got a lot of coverage.  Here are links to what people are saying about the game lately:</p>
<p>First, a <a href="http://www.gamespot.com/events/gdc-2012/video.html?sid=6365133">video interview on Gamespot</a> (excerpted; we probably talked for 45 minutes or an hour).</p>
<p>Kirk Hamilton at Kotaku finds <a href="http://kotaku.com/5893336/jonathan-blows-the-witness-is-an-exercise-in-symphonic-game-design">a musical treatment for The Witness&#8217; game design philosophy</a>.</p>
<p>Ben Kuchera at the Penny Arcade Report, with <a href="http://penny-arcade.com/report/editorial-article/steam-vs.-xbox-live-arcade-jonathan-blow-explains-why-microsoft-is-aiming-a">a piece about online distribution channels</a>, and <a href="http://penny-arcade.com/report/editorial-article/jonathan-is-betting-2.5-million-youll-like-the-witness-as-much-as-braid">another biz-focused one</a>.</p>
<p>Ben Gilbert at Joystiq, with <a href="http://www.joystiq.com/2012/03/14/the-witness-cares-about-you-more-than-you-know">a design-oriented posting</a> and also <a href="http://www.joystiq.com/2012/03/12/the-witness-is-jon-blows-second-shot-at-all-or-nothing">a more biz-like one</a>.</p>
<p>Alex Rubens from G4 with <a href="http://www.g4tv.com/games/xbox-360/65972/the-witness/articles/76862/the-witness-preview-how-to-unbraid-modern-game-design">an overall preview of the game</a>.</p>
<p>Daniel Starkey of Destructoid, <a href="http://www.destructoid.com/gdc-witnessing-jonathan-blow-s-the-witness-223458.phtml ">with a preview as well</a>.</p>
<p>As you can see from the write-ups, people seemed to really dig the game.  So that is all good.</p>
<p>Keep in mind that, because I am known for my previous game and and the reporters are there talking directly to me, the tone that tends to get adopted in these write-ups makes it sound as though I were making the game myself.  That&#8217;s not the case; there&#8217;s a good-sized team of very talented people building the game!  (This reminds me that we need to update the About page to list everyone who is currently working on the project.)</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/03/post-gdc-update/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Seamless Cube Map Filtering</title>
		<link>http://the-witness.net/news/2012/02/seamless-cube-map-filtering/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=seamless-cube-map-filtering</link>
		<comments>http://the-witness.net/news/2012/02/seamless-cube-map-filtering/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 18:36:38 +0000</pubDate>
		<dc:creator>Ignacio Castaño</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1502</guid>
		<description><![CDATA[Modern GPUs filter seamlessly across cube map faces. This feature is enabled automatically when using Direct3D 10 and 11 and in OpenGL when using the ARB_seamless_cube_map extension. However, it&#8217;s not exposed through Direct3D 9 and it&#8217;s just not available in any of the current generation consoles. There are several solutions for this problem. Texture borders [...]]]></description>
			<content:encoded><![CDATA[<p>Modern GPUs filter seamlessly across cube map faces. This feature is enabled automatically when using Direct3D 10 and 11 and in OpenGL when using the <a href="http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt">ARB_seamless_cube_map</a> extension. However, it&#8217;s not exposed through Direct3D 9 and it&#8217;s just not available in any of the current generation consoles.<br />
<span id="more-1502"></span><br />
There are several solutions for this problem. Texture borders solve it elegantly, but are not available on all hardware, and only exposed through the OpenGL API (and proprietary APIs in some consoles).</p>
<p>When textures are static a common solution is to pre-process them in an attempt to eliminate the edge seams. In a short siggraph sketch, John Isidoro <a href="http://developer.amd.com/media/gpu_assets/Isidoro-CubeMapFiltering-Sketch-SIG05.pdf">proposed averaging cube map edge texels</a> across edges and obscuring the effect of the averaging by adjusting the intensity of the nearby texels using various methods. These methods are implemented in <a href="http://developer.amd.com/archive/gpu/cubemapgen/pages/default.aspx">AMD&#8217;s CubeMapGen</a>, whose source code is now <a href="http://code.google.com/p/cubemapgen/">publicly available online</a>. While this seems like a good idea, a few minutes experimenting with CubeMapGen make it obvious that it does not always work very well!</p>
<h2>Embedded Texture Borders</h2>
<p>A very simple solution that even works for dynamic cube maps is to slightly increase the FOV of the perspective projection so that the edges of adjacent faces match up exactly. <a href="http://www.gamedev.net/blog/73/entry-2005516-seamless-filtering-across-faces-of-dynamic-cube-map/">Ysaneya shows</a> that in order to achieve that, the FOV needs to be tweaked as follows:</p>
<p><code>fov = 2.0 * atan(n / (n - 0.5))</code></p>
<p>where <code>n</code> is the resolution of the cube map.</p>
<p>What this is essentially doing is to scale down the face images by one texel and padding them with a border of texels that is shared between adjacent faces. Since the texels at the face edges are now identical the seams are gone. </p>
<p>In practice this is much trickier than it sounds. While the fragments at the adjacent face borders should sample the scene in the same direction, rasterization rules do not guarantee that in both cases the rasterized fragments will match.</p>
<p>However, if we take this idea to the realm of offline cube map generation, we can easily guarantee exact results. Cube maps are often used to store directional functions. Each texel has an associated uv coordinate within the cube map face, from which we derive a direction vector that is then used to sample our directional function. Examples of such functions include expensive BRDFs that we would like to precompute, or an environment map sampled using angular extent filtering.</p>
<p>Usually these uv coordinates are computed so that the resulting direction vectors point to the texel centers. For an integer texel coordinate <code>x</code> in the <code>[0,n-1]</code> range we map it to a floating point coordinate <code>u</code> in the <code>[-1, 1]</code> range as follows:</p>
<p><code>map_1(x) = (x + 0.5) * 2 / n - 1</code></p>
<p>We then obtain the corresponding direction vector as follows:</p>
<p><code>dir = normalize(faceVector + faceU * map_1(x) + faceV * map_1(y)</code></p>
<p>When doing that, the texels at the borders do not map to <code>-1</code> and <code>1</code> exactly, but to:</p>
<p><code>
<pre>
map(0) = -1 + 1/n
map(n-1) = 1 - 1/n
</pre>
<p></code></p>
<p>In our case we want the edges of each face to match up exactly to they result in the same direction vectors. That can be achieved with a function like this:</p>
<p><code>map_2(x) = 2 * x / (n - 1) - 1</code></p>
<p>If we use this map to sample our directional function, the resulting cube map is seamless, but the face images are scaled down uniformly. In the first case the slope of the map is:</p>
<p><code>map_1'(x) = 2 / n</code></p>
<p>but in the second case it is slightly different:</p>
<p><code>map_2'(x) = 2 / (n - 1)</code></p>
<p>This technique works very well at high resolutions. When n is sufficiently high, the change in slope between map_1 and map_2 becomes minimal. However, at low resolutions the stretching on the interior of the face can become noticeable.</p>
<p>A better solution is to stretch the image only in the proximity of the edges. That can be achieved warping the uv face coordinates with a cubic polynomial of this form:</p>
<p><img src="http://the-witness.net/news/wp-content/uploads/2012/02/warp.png" alt="" width="360" height="222" class="alignright size-full wp-image-1545" /><code>warp3(x) = ax^3 + x</code></p>
<p>We can compose this function with our original mapping. The result around the origin is close to a linear identity, but we can adjust <code>a</code> to stretch the function closer to the face edges. In our case we want the values at <code>1-1/n</code> to produce <code>1</code> instead, so we can easily determine the value of <code>a</code> by solving:</p>
<p><code>warp3(1-1/n) = ax^3 + x = 1</code></p>
<p>which gives us:</p>
<p><code>a = n^2 / (n-1)^3</code></p>
<p>I implemented the linear stretch and cubic warping methods in <a href="http://code.google.com/p/nvidia-texture-tools/">NVTT</a> and they often produce better results than the methods available in AMD&#8217;s CubeMapGen. However, I was not entirely satisfied. While this removed the zero-order discontinuity, it introduced a first-order discontinuity that in some cases was even more noticeable than the artifacts it was intended to remove.</p>
<p>You can hover the cursor over the following image to show how the warp edge fixup method eliminates the discontinuities, but sometimes still results in visible artifacts:</p>
<p><a><img src="http://the-witness.net/news/wp-content/uploads/2012/02/seamless_warp.png" alt="" width="560" height="273" class="hover alignnone size-full wp-image-1546" /><img src="http://the-witness.net/news/wp-content/uploads/2012/02/seams.png" alt="" width="560" height="273" class="nohover alignnone size-full wp-image-1547" /></a></p>
<p>Any edge fixup method is going to force the slope of the color gradient across the edge to be zero, because it needs to duplicate the border texels. The eye seems to be very sensible to this form of discontinuity and it&#8217;s questionable whether this is better than the original artifact. Maybe other warp functions would make the discontinuity less obvious, or maybe it could be smoothed like Isidoro&#8217;s method do. At the time I implemented this I thought the remaining artifacts did not deserve more attention and moved on to other tasks.</p>
<h2>Modifed Texture Lookup</h2>
<p>However, a few days ago <a href="https://twitter.com/#!/SebLagarde">Sebastien Lagarde</a> integrated these methods in AMD&#8217;s CubeMapGen. See <a href="http://seblagarde.wordpress.com/2012/02/26/amd-cubemapgen-for-physically-based-rendering/">this post</a> for more results and comparisons against other methods. That got me thinking again about this and then I realized that the only thing that needs to be done to avoid the seams is to modify the texture coordinates at runtime the same way we modify them during the offline cube map evaluation. At first I thought that would be impractical, because it would require projecting the texture coordinates onto the cube map faces, but turns out that the resulting math is very simple. In the case of the uniform stretch that I first suggested, the transform required at runtime is just a conditional per-component multiplication:</p>
<p><code>
<pre>
float3 fix_cube_lookup(float3 v) {
   float M = max(max(abs(v.x), abs(v.y)), abs(v.z));
   float scale = (cube_size - 1) / cube_size;
   if (abs(v.x) != M) v.x *= scale;
   if (abs(v.y) != M) v.y *= scale;
   if (abs(v.z) != M) v.z *= scale;
   return v;
}
</pre>
<p></code></p>
<p>One problem is that we need to know the size of the cube map face in advance, but every mipmap has a different size and we may not know what mipmap is going to be sampled in advance. So, this method only works when explicit LOD is used.</p>
<p>Another issue is that with trilinear filtering enabled, the hardware samples from two contiguous mipmap levels. Ideally we would have to use a different scale factor for each mipmap level. That could be achieved sampling them separately and combining the result manually, but in practice, using the same scale for both levels seems to produce fairly good results. We can easily find a scale factor that works well for fractional LODs as a function of the LOD value and the size of the top level mipmap:</p>
<p><code>
<pre>
float scale = 1 - exp2(lod) / cube_size;
if (abs(v.x) != M) v.x *= scale;
if (abs(v.y) != M) v.y *= scale;
if (abs(v.z) != M) v.z *= scale;
</pre>
<p></code></p>
<p>If you are using cube maps to store prefiltered environment maps, chances are you are computing the cube map LOD from the specular power using <code>log2(specular_power)</code>. If that&#8217;s the case, the two transcendental instructions cancel out and the scale becomes a linear function of the specular power.</p>
<p>The images below show the results using the warp filtering method (these were chosen to highlight the artifacts of the warp method). Hover the cursor over the images to visualize the results of the new approach:</p>
<p><a><img src="http://the-witness.net/news/wp-content/uploads/2012/02/examples_warp.png" alt="" width="566" height="582" class="nohover alignnone size-full wp-image-1549" /><img src="http://the-witness.net/news/wp-content/uploads/2012/02/examples_seamless.png" alt="" width="566" height="582" class="hover alignnone size-full wp-image-1548" /></a></p>
<p>I&#8217;d like to thank Sebastien Lagarde for his valuable feedback while testing these ideas and for providing the nice images accompanying this article.</p>
<p><em>Note: This article is also published at <a href="http://altdevblogaday.com/2012/02/27/seamless-cube-map-filtering/">AltDevBlogADay</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/02/seamless-cube-map-filtering/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Playtest; Island Update</title>
		<link>http://the-witness.net/news/2012/02/playtest-island-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=playtest-island-update</link>
		<comments>http://the-witness.net/news/2012/02/playtest-island-update/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 20:09:51 +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=1494</guid>
		<description><![CDATA[Here&#8217;s how the island looks today: The current puzzle count is 440. As expected in the previous update, over the past week or so I went back and worked on the endgame again. I built an original version of the endgame last summer; I had one friend playtest it, and it worked out pretty well, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how the island looks today:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/02/shot_2012.02.24__time_12_07_n02.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/02/shot_2012.02.24__time_12_07_n02-512x288.png" alt="" title="shot_2012.02.24__time_12_07_n02" width="512" height="288" class="aligncenter size-large wp-image-1495" /></a></p>
<p>The current puzzle count is 440.</p>
<p>As expected in <a href="http://the-witness.net/news/2012/02/island-snapshot-4/">the previous update</a>, over the past week or so I went back and worked on the endgame again.  I built an original version of the endgame last summer; I had one friend playtest it, and it worked out pretty well, though I felt it wasn&#8217;t quite epic enough.  I didn&#8217;t know what more to do with it at the time, so I just let it sit, and went to thinking about other parts of the game.</p>
<p>Lately I had more ideas for the endgame, so I went into personal crunch mode and rebuilt into something more epic.  This was one of the most productive periods of my working life (maybe the most productive) and I think this area, all taken together, may be the most interesting thing I have ever designed.  However, it may be a little too difficult for the player, at the moment!  Today I playtested this endgame and one other area of the game, with a game designer friend of mine, and it took <strong>nine and a half hours</strong> to play through these two areas (6 hours for the endgame, 3.5 hours for the other area).  I think this is a little long, so I am going to be tuning these areas and cleaning them up a little bit.  This weekend hopefully I can get in some playtest time with Jeff and Casey of <a href="http://www.jeffandcaseytime.com/s01_b02_c01out.htm"><em>Jeff and Casey Time</em></a>, so if that happens we will see how it goes.</p>
<p>(It&#8217;s interesting; I haven&#8217;t done a playtest of The Witness for a while, but I was still thinking of it as a 10-15 hour game, and that&#8217;s what I tell people when they ask.  But if these two areas by themselves, even after being cleaned up, are 6-7 hours of playtime, that means the whole game is &#8230; &#8230; much longer.  Sometime in a month or two, I&#8217;ll do some playtests with people who have never seen the game before, and we&#8217;ll see how long it really is.)</p>
<p>Meanwhile, on the art side, we&#8217;ve been working on the style of the game; expect a future blog post as we come to conclusions on that.  </p>
<p>Tech-wise, Andy has been working on performance stuff.  First he made raycasting much faster; til now the game had been relatively lazy about spatial organization.  Andy implemented a quadtree for finding entities in the world and enabled k-d tree generation and serialization for casting rays against individual meshes.  (We had k-d tree code already as part of a library but weren&#8217;t using it.)  Salvador is working on in-game animation playback, as well as exporting; until now we have been making do without animations, but once this is in the game it will help us with a number of issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/02/playtest-island-update/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Dear Esther is out.</title>
		<link>http://the-witness.net/news/2012/02/dear-esther-is-out/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dear-esther-is-out</link>
		<comments>http://the-witness.net/news/2012/02/dear-esther-is-out/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 20:47:07 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Other Games]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1485</guid>
		<description><![CDATA[[This message is crossposted from the Indie Fund blog.] Our gift to you, on this very special Valentine&#8217;s Day, is the worldwide release of the long-awaited game Dear Esther. If you haven&#8217;t heard of Dear Esther, watch this: (Or hey, watch the trailer even if you are quite familiar with the game; the trailer is [...]]]></description>
			<content:encoded><![CDATA[<p>[This message is crossposted from <a href="http://indie-fund.com/">the Indie Fund blog</a>.]</p>
<p>Our gift to you, on this very special Valentine&#8217;s Day, is the worldwide release of the long-awaited game Dear Esther.</p>
<p>If you haven&#8217;t heard of Dear Esther, watch this:</p>
<p><a href="http://www.youtube.com/watch?v=D7VJ4lP-05A"><img src="http://img.youtube.com/vi/D7VJ4lP-05A/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=D7VJ4lP-05A">Click here</a> to view the video on YouTube.</p>

<p>(Or hey, watch the trailer even if you are quite familiar with the game; the trailer is beautiful and worthy of multiple viewings.)</p>
<p>We expect public reception of this game to run wide: some will love it, and others will be very concerned about whether this thing can be called a game and what that means. So far, this has certainly been the case in pre-release reviews.</p>
<p>Game Informer <a href="http://www.gameinformer.com/games/dear_esther/b/pc/archive/2012/02/13/a-haunting-indie-story-worth-listening-to.aspx">scored the game an 8/10</a>, saying: &#8220;You should consider checking out Dear Esther the same way you’d appraise a film. If you’re interested in absorbing an intellectual story and gorgeous visuals without having to exert a drop of effort, take a chance on this curious experiment.&#8221;</p>
<p>VideoGamer.com <a href="http://www.videogamer.com/pc/dear_esther/review.html">scored the game a 9</a>: &#8220;Discovery is such an important part of Dear Esther, especially when everything is so phenomenally pretty.&#8221;</p>
<p>Meanwhile, Destructoid <a href="http://www.destructoid.com/review-dear-esther-221082.phtml">gave the game a lowly 4.5/10</a>: &#8220;It’s as if it wants to be a part of this wonderful medium of ours without asking itself why, which is exactly why you should seek it out and learn from its failures as a game enthusiast, critic, or developer.&#8221;</p>
<p>We like that there&#8217;s such a big difference of opinion because it means the game is breaking new ground. It&#8217;s playing in territory that is not safe; there is no established understanding there.</p>
<p>Dear Esther is a game that no publisher would have funded. Dan, Rob, Jessica and the other associates of thechineseroom have done an excellent job putting together a beautiful game. We are happy to be backing it; we hope you enjoy playing it.</p>
<p>If you&#8217;d like more information about Dear Esther, here&#8217;s an <a href="http://www.gamernode.com/dear-esther-interview-with-creator-dan-pinchbeck/">interview with Dan</a>, and here&#8217;s a link <a href="http://store.steampowered.com/app/203810/">the game&#8217;s page on Steam</a>.</p>
<p><strong>Update: Dear Esther has been wildly successful, selling 16,000 copies in under 24 hours. </strong> As an investment, it reached profitability in 5.5 hours.  <a href="http://indie-fund.com/2012/02/dear-esther-has-reached-profitability-it-took-5-hours-30-minutes/">More details are available at a new post on the Indie Fund blog.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/02/dear-esther-is-out/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Island Snapshot</title>
		<link>http://the-witness.net/news/2012/02/island-snapshot-4/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-snapshot-4</link>
		<comments>http://the-witness.net/news/2012/02/island-snapshot-4/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 01:52:57 +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=1479</guid>
		<description><![CDATA[Here&#8217;s how the island looks right now. It is a bit crazy and messy, especially the stuff nearest the camera: This is because this corner of the world is one of the last areas that we haven&#8217;t really figured out, in terms of what goes where. There is sort of just some random stuff dumped [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how the island looks right now.  It is a bit crazy and messy, especially the stuff nearest the camera:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2012/02/shot_2012.02.01__time_17_15_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2012/02/shot_2012.02.01__time_17_15_n01-512x288.png" alt="" title="shot_2012.02.01__time_17_15_n01" width="512" height="288" class="aligncenter size-large wp-image-1481" /></a></p>
<p>This is because this corner of the world is one of the last areas that we haven&#8217;t really figured out, in terms of what goes where.  There is sort of just some random stuff dumped there right now.  That will change pretty soon.</p>
<p>Expect the next few island snapshots to show a lot of big changes.  We&#8217;ve reached the point where the basic gameplay is settled, I&#8217;m refining many of the specific puzzles, and we&#8217;ve got at least rough drafts of many of the architectural layouts.  That means we can start planning the island a bit better.  Over the next month or so, we&#8217;re going to be changing the shape of the island to something a little more geologically plausible, something that carries more information.  It&#8217;s going to be interesting to do this without disrupting the gameplay layout of the island too much.  </p>
<p>The current puzzle count is 427.  In January I scrapped and re-designed an area and its 60-or-so puzzles.  The previous area was inside dark caves, which is a bit cliche, and the gameplay hook that motivated my setting that area in caves, which I had hoped would be cool, didn&#8217;t work very well.  In addition, I felt that the puzzles themselves, while fitting into the rest of the game, were the weakest part of the game.  I&#8217;d been feeling this way for a long time, but I didn&#8217;t have a good solution for it til late December.  I moved the location and redesigned the puzzles.  Now the theme of the location is totally different, has a gameplay hook that works way better than the cave thing, and is very cool.  The puzzles situated in this area are also much stronger than before, because I found a way to change the rules of those puzzles to make them much tighter.  They&#8217;d felt wishy-washy before (people would play through that area and, after finishing, lack clarity on what the puzzles were saying.  That&#8217;s no good.)</p>
<p>We certainly could have shipped the game with the old area in the caves with the old puzzles, and probably shipped the game at least a month sooner, but an important skill in building a beautiful game is knowing when something just isn&#8217;t good enough.</p>
<p>Next I am going back to the endgame, which I did my first pass at last summer sometime; I&#8217;ve got a gameplay hook to add which I think will bring it over the top and make it extra-good. I&#8217;ll be working on that over the next few weeks while also working with the landscape architects on the island revision.</p>
<p>Also, we&#8217;ve got a new programmer starting soon (this week or next!)  Combined with our other new addition, who&#8217;s been here a few weeks (Andrew Smith, ex-Zipper and -Oddworld; hi Andy!) we will have quite a bit of tech manpower to bring to bear on finishing this game.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/02/island-snapshot-4/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>The trailer for Dear Esther is out now.</title>
		<link>http://the-witness.net/news/2012/01/the-trailer-for-dear-esther-is-out-now/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-trailer-for-dear-esther-is-out-now</link>
		<comments>http://the-witness.net/news/2012/01/the-trailer-for-dear-esther-is-out-now/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 17:39:18 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Other Games]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1466</guid>
		<description><![CDATA[If you&#8217;re interested in arty games that push the boundaries of what games are doing, you may be interested in Dear Esther, which will be released on Valentine&#8217;s Day of this year (much sooner than The Witness will be!) The trailer has just been released: See more about Dear Esther at the official site. This [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re interested in arty games that push the boundaries of what games are doing, you may be interested in Dear Esther, which will be released on Valentine&#8217;s Day of this year (much sooner than The Witness will be!)  </p>
<p>The trailer has just been released:</p>
<p><a href="http://www.youtube.com/watch?v=D7VJ4lP-05A"><img src="http://img.youtube.com/vi/D7VJ4lP-05A/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=D7VJ4lP-05A">Click here</a> to view the video on YouTube.</p>

<p><a href="http://dear-esther.com/">See more about Dear Esther at the official site.</a></p>
<p>This will be the second Indie Fund game to release.  Just a few days ago we announced that <a href="http://indie-fund.com/2012/01/q-u-b-e-recoups-investment/">Q.U.B.E., the first funded game, is already a financial success</a>.  It appears obvious that Dear Esther will be as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2012/01/the-trailer-for-dear-esther-is-out-now/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>Engine Tech: Concurrent world editing</title>
		<link>http://the-witness.net/news/2011/12/engine-tech-concurrent-world-editing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=engine-tech-concurrent-world-editing</link>
		<comments>http://the-witness.net/news/2011/12/engine-tech-concurrent-world-editing/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 22:39:32 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1429</guid>
		<description><![CDATA[Summary A small team with limited manpower, we wanted a low-effort way to use our existing version control system (svn) to facilitate concurrent world editing for our open-world 3D game (i.e. we desire that multiple users can edit the world at the same time and merge their changes).  We developed a system wherein the data [...]]]></description>
			<content:encoded><![CDATA[<h2>Summary</h2>
<p>A small team with limited manpower, we wanted a low-effort way to use our existing version control system (svn) to facilitate concurrent world editing for our open-world 3D game (i.e. we desire that multiple users can edit the world at the same time and merge their changes).  We developed a system wherein the data for each entity is stored as an individual text file.  This sounds crazy, but it works well: the use of individual files gives us robustness in the face of merge conflicts, and despite the large number of files, the game starts up quickly.  Entities are identified using integer serial numbers.  We have a scheme for allocating ranges of these numbers to individual users so there is no overlap (though this scheme could certainly be better).  The system seems now to be robust enough to last us through shipping the game, with seven people and one automated build process concurrently editing the world across 18 different computers.</p>
<p>We don&#8217;t know whether this method would work for AAA-sized teams, though it seems that it might with some straightforward extensions.  But for us the method works surprisingly well, given how low-tech it is.</p>
<p><span id="more-1429"></span></p>
<h2>About the Game</h2>
<p>We have been developing a 3D open-world game called <a href="http://the-witness.net">The Witness</a> since late 2008.  For much of that time, development happened in a preproduction kind of way, where not many people were working on the game.  Recently, though, we went into more of a shipping mode, so the number of developers has grown: we&#8217;re up to about 10 or 11 people now (pretty big for a non-high-budget, independent game).  Not all of these people directly touch the game data, but about 7 do now, and this number will rise to 9 in the near future.</p>
<p>The design of the game requires the world to be spatially compact, relative to other open-world games, so it is far from Skyrim-esque in terms of area or number of entities.  At the time of this writing, there are 10,422 entities in the game world.  I expect this number to grow before the game is done, but probably not by more than 2x or 3x the current amount.</p>
<p>Because the world is not too big, and some game-level events require entities to coordinate across the length of the world, it makes sense to keep all the entities in one space, that is to say, there is no zoning of the world or partitioning of it into separate sets of data.  This makes the engine simpler, and it reduces the number of implementation details that we need to think about when editing the world.  It also introduces a bit of a challenge, because it requires us to support concurrent editing of the world without an explicit control structure governing who can edit what.  One such control structure might be: if you imagine the world were divided into a 10&#215;10 grid; so there are 100 different zones; and where anyone editing the world must lock whatever zones they want to edit, make their changes, check them in, then unlock those zones; this would provide a very clear method of ordering world edits.  (Because of the locking mechanism, two people would not be able to change the same world entity at the same time, so there doesn&#8217;t have to be any resolution process to decide whose changes are authoritative). However, the straightforward implementation of such a control scheme would make for inconvenient workflow, as it is tedious to lock and unlock things.  Even with further implementation work and a well-streamlined UI, there would still be big inconveniences (I really want to finish building a particular puzzle right now, but a corner of that puzzle just borders on some region that a different user has locked, and he is sick this week so he probably won&#8217;t finish his work and unlock it until next week.  Or, if my network connection is flaky then I may not be able to edit; if I am off the net then I definitely could not edit.)</p>
<p>Thus, rather than implementing some kind of manual locking, I found it preferable to envision a system that Just Magically Works.  Since we already used the Subversion source-control system to manage source code and binary source assets such as texture maps and meshes, it didn&#8217;t seem like too big of a stretch for Subversion to handle entity data as well.</p>
<h2>The World Editor and Entity Data</h2>
<p>Our world editor is built into the game; you press a key to open it at any time.  Here&#8217;s what it looks like:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/12/editor_shot.png"><img class="aligncenter size-large wp-image-1430" title="editor_shot" src="http://the-witness.net/news/wp-content/uploads/2011/12/editor_shot-512x288.png" alt="" width="512" height="288" /></a></p>
<p>The editor view is rendered in exactly the same way as the gameplay view, but you fly the camera around and select entities (I have selected the red metal door at the center of the scene, so it is surrounded by a violet wireframe).  In the upper right, I have a panel where I can edit all the relevant properties of this Door; the properties are organized into four tabs and here you can see only one, the &#8220;Common&#8221; properties.</p>
<p>These properties, which you can edit by typing into the fields of this Entity panel, are all that the game needs to instantiate and render this particular entity (apart from heavier-weight shared assets like meshes and texture maps).  If you serialize all these fields, then you can unserialize them and generate a duplicate of this Door.  That&#8217;s how the editor saves the world state: serialize every entity, and for each entity, serialize all fields.</p>
<p>Originally, the game saved all entities into one file in a binary format.  This is most efficient, CPU-performance-wise, and the natural thing that most performance-minded programmers would do first.  Unfortunately, though, svn can&#8217;t make sense of such a file, so if two people make edits, even to disjoint parts of the world, svn is likely to produce a conflict; once that happens, it&#8217;s basically impossible to resolve the situation without throwing away someone&#8217;s changes or taking drastic data recovery steps.</p>
<p>Our natural first step was to change this file from binary into a textual format.  Originally I had worries about the load-time performance of parsing a textual file, but this turned out not to be an issue.  I decided to use a custom file format, because the demands in this case are very simple, and we have maximum control over the format and can modify it to suit our tastes.</p>
<p>Many modern programmers seem to have some kind of knee-jerk inclination to use XML whenever a textual format is desired, but I think XML is one of the worst file formats ever created, and I have no idea why anyone uses it for anything at all, except that perhaps they drank the XML Kool-Aid or have XML Stockholm Syndrome.  Yes, there are XML-specific tools out there in the world, and whatever, but I didn&#8217;t see how any such tool would be of practical use to us.  One of our primary concerns is human-readability, so that people can make intelligent decisions when attempting to resolve revision control conflicts.  XML is not particularly readable, but we can modify our own format to be as readable as it needs to be in response to whatever real-world problems arise.  You&#8217;ll see a snippet below of the format we use.</p>
<h2>Evolution of the Textual Format</h2>
<p>The first version of our textual format was a straightforward adaptation of our binary format.  The gameplay-level code that saves and loads entities is the same for either format; the only difference is just a boolean parameter, choosing textual or binary, which is passed to the lower-level buffering code.  After the buffer is done being packed, it&#8217;s written to a file.</p>
<p>In our engine, entities are generally referenced using integer serial numbers (that act as handles).  These numbers are the same when serialized as they are at runtime.  Originally, in the binary file, the order in which the entities were written didn&#8217;t matter.  But if we want to handle concurrent edits, we want to make merging as easy as possible for the source control system, so we sort entities by serial number, writing them into the file in increasing order.  Thus we didn&#8217;t generate any spurious file changes due to haphazardly-changing serialization order.</p>
<p>In theory, Subversion could now handle simultaneous world edits and just merge them, the same way it does with our source code.  Unsurprisingly, though, this initial attempt was not sufficient.  Though the file was now textual, it contained a bare minimum of annotations and concessions to readability.  Though I knew I would eventually want to add more annotations, I didn&#8217;t want to go overboard if it wasn&#8217;t necessary, because these inflate the file size and the time required to parse the files (though I never measured by how much, so it&#8217;s likely the increases are negligible performance-wise and I was engaging in classic premature optimization).  As it happens, the kind of redundant information that increases human-readability also helps the source control system understand file changes unambiguously, so as we made the format more-readable, the number of conflicts fell.</p>
<p>Here&#8217;s what our file format currently looks like, for entity #6555 (the Door we had selected in the editor screenshot).</p>
<pre style="padding-left: 30px;">Door
72
6555
; position
    46.103531 : 42386a04
    108.079681 : 42d828cc
    8.694907 : 410b1e57
; orientation
    0.000000 : 0
    0.000000 : 0
    -0.069125 : bd8d9184
    0.997608 : 3f7f633d
; entity_flags
    160
; entity_name
    !
; group_id
    4059
; mount_parent_id
    6554
; mount_position
    0.035274 : 3d107ba5
    0.006069 : 3bc6e19c
    0.000038 : 381ffffc
; mount_orientation
    0.000000 : 0
    0.000000 : 0
    0.000027 : 37e5f004
    1.000000 : 3f800000</pre>
<p>(The first line, &#8220;Door&#8221;, is the type name; 72 is the entity data version, which is used to load older versions of entities as their properties change over time; 6555 is the entity&#8217;s ID.  root_z and cluster_id (seen in the screenshot) are not saved into the file, because these properties have metadata that say they are only saved or loaded under certain conditions which are not true here.  For the sake of making the listing short, I&#8217;ve shown only the properties listed on that first tab in the screenshot.)<br />
You&#8217;ll note that the floating-point numbers are written out a bit oddly, as in this first line under &#8216;position&#8217;:</p>
<pre style="padding-left: 30px;">    46.103531 : 42386a04</pre>
<p>This is how we preserve the exact values of floating-point numbers despite saving and loading them in a text file.  If you do not take some kind of precaution, and use naive string formatting and parsing, your floating-point values are likely to change by an LSB or two, which can be troublesome.</p>
<p>The number on the left is a straightforward decimal representation of the value, written with a reasonable number of digits.  The : tells us that we have another representation to look at; the number on the right, which the : introduces, is the hexadecimal representation of the same number.  The IEEE 754 floating-point standard defines this representation very specifically, so we can use this hexadecimal representation to reproduce the number exactly, even across different hardware platforms.  The decimal representation is mostly just here to aid readability.  However, if we decide we want to hand-edit the file, we can just delete the : and everything after it, changing that first number to a 47.5 or something; seeing no :, the game will parse the decimal representation and use that instead.</p>
<p>There are other ways to solve this floating-point exactness problem; for example, you can implement an algorithm that reads and writes the decimal representation in a manner that carefully preserves the values.  This is complicated, but if you&#8217;re interested in that kind of thing, here&#8217;s what Chris Hecker says:</p>
<blockquote><p>Everybody just uses David Gay&#8217;s code:<br />
<a href="http://www.netlib.org/fp/dtoa.c">http://www.netlib.org/fp/dtoa.c<br />
</a><a href="http://www.netlib.org/fp/g_fmt.c">http://www.netlib.org/fp/g_fmt.c</a></p>
<p>You need to get the flags set right on the compiler for it to work. /fp:precise at least, I also do #pragma optimize (&#8220;p&#8221;,on), and make sure you write a test program for it with your compiler settings.</p></blockquote>
<p>(Twitchy, and look at how much code that is!  What we did is a couple of lines.) In <a href="http://cbloom.com/3d/game_tech_04.zip">a document</a> on his <a href="http://www.cbloom.com/3d/">web site</a>, Charles Bloom discusses a scheme that was in use at Oddworld Inhabitants, similar to what we&#8217;re doing in The Witness but involving a comparison between the two representations:</p>
<blockquote><p>&#8230; Plain text extraction of floats drifts because of the ASCII conversions; to prevent this, we simply store the binary version in the text file in addition to the human readable version; if they are reasonably close to each other, we use the binary version instead so that floats can be persisted exactly.</p></blockquote>
<h2>Subversion Confusion</h2>
<p>After switching to this format, conflicts still happened.  I categorize conflicts into two types: &#8220;legitimate&#8221;, where two people edit the same entity in contradictory ways and the source control system doesn&#8217;t know who to believe; and &#8220;illegitimate&#8221;, where Subversion was just getting confused.  We did have a number of legitimate conflicts for a while, yet which were not the users&#8217; fault, because our world editor tended to do things that are bad in a concurrent-editing environment.  (See the Logistics section at the end of this article for some examples).  But even after we ironed these out, we still found that Subversion was still getting confused.</p>
<p>Here&#8217;s an example of a common problem: suppose we start with a world containing data on entities A, B, and D, so our file contains: ABD.  You edit the file and delete entity B.  I edit the file and also delete entity B, but add another entity C.  (That we both deleted B may be a very common use-case, especially if this is due to some automatic editor function).  So, you want to check in a file that just says: ABD &#8211; B = AD, so the new result is AD.  I want to check in a file that says: ABD &#8211; B + C = ACD (the C goes in the middle, because remember, the entities are sorted!)  In theory this is an easy merge: the correct result is just ACD.  But Subversion would get confused in cases like this, requiring the user to hand-merge the file.</p>
<p>This is a disaster, because even with a visual merge tool such as the one that comes with TortoiseSVN, you don&#8217;t want non-engine-programmers trying to merge your entity data file.  Even if that file is extremely readable, at some point someone will make a mistake; the file will fail to parse, and then you have a data recovery problem that requires the attention of an engine programmer.  When this happens it kills the productivity of two people (the engine guy, because he has to merge the data, and also the guy who generated the conflict, because until it gets resolved his game is in an un-runnable state, and anyway, the engine guy has probably commandeered the other guy&#8217;s computer to fix this).</p>
<p>After we had this problem a few times too many, Ignacio suggested moving to a more-structured file format like JSON, which, in theory, source-control systems would handle more solidly.  But I thought that this would only reduce the frequency of the problem, but not solve anything fundamental; even if we achieved a situation of only generating legitimate conflicts, each conflict would still be a potential game-crippling disaster.</p>
<h2>Splitting the File</h2>
<p>It occurred to me, finally, that it could hardly get cleaner than to store each entity in its own file.  This initial thought might cause a performance-oriented programmer to recoil in horror; we have 10,422 entities right now, and it must be very slow to parse and load 10,000 text files every time the game starts up!</p>
<p>But I knew that we already had over 4,000 individual files laying around for assets like meshes and texture maps, currently loaded individually, the idea being that at ship time we would combine these into one package so as to avoid extra disk seeks and the like.  But on our development machines, these files still loaded quickly.  I figured that if we can already load 4,000 big files, why not try loading an extra 10,000 small files?  If loading all these files turned out to be slow, we could resort to this only when entity data has changed via a source control update; after loading all the text files, we can save out a single binary file containing all the entity data, which would be much faster to load, just like we used to do before we supported concurrent editing.</p>
<p>I tried this and it worked great.  So, now we have a data folder called &#8216;entities&#8217;, which holds one file per serialized entity.  The Door selected in the editor screenshot is stored in a file named after its entity ID, &#8220;6555.entity_text&#8221;, which contains the text you see in the listing above.</p>
<p>As mentioned, there are currently 10422 entity files; the text files take up about 8MB of space, whereas the binary file is 1.4MB.  We&#8217;re not making any effort to compress either of these formats; they are very small compared to the rest of our data.</p>
<p>&nbsp;</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/12/dos_box_file_list.png"><img class="aligncenter size-large wp-image-1435" title="dos_box_file_list" src="http://the-witness.net/news/wp-content/uploads/2011/12/dos_box_file_list-512x333.png" alt="" width="512" height="333" /></a></p>
<p>&nbsp;</p>
<h2>Benefits of Using Individual Files</h2>
<p>Storing each entity in a separate file solved our problems with merging: both the illegitimate source control confusions as well as the problems due to hand-guided file merging.</p>
<p>The illegitimate conflicts go away because transactions become very clear.  If I delete an entity, and you delete an entity, then we both just issue a file delete command, and it&#8217;s very easy for the source control system to see that we agree on the action.  Furthermore, if we both delete B but I add C, because the change to C is happening in a completely separate file, there is no way for the system to get confused about what happened.</p>
<p>Legitimate conflicts do still happen, as multiple people edit the same entities, but these cases are much easier to handle than they were before.  The usual response is to either revert one whole entity or stomp it with your own.  Because we usually want to treat individual entities atomically &#8212; using either one person&#8217;s version of that entity or the other&#8217;s &#8212; individual files are a great match, because now the usual actions we want to perform are top-level source control commands (usually from the TortoiseSVN pulldown menu); before, this wasn&#8217;t true, and merging a single entity in an atomic way required careful use of the merge tool.  If an entity ever gets corrupted somehow, for whatever reason, we can just revert that one file, knowing the damage is very limited in scope; before we&#8217;ve reverted it, the worst that can happen is that that single entity will not load; it won&#8217;t prevent the rest of the entities in the world from loading.</p>
<p>It would be difficult to overemphasize the robustness gained.  I feel that these sentences do not quite convey the subtle magic; it feels a little like the state change when a material transitions from a liquid to a solid.</p>
<p>Sometimes, someone will update their game data in a non-vigilant way; not noticing that a conflict happened, so they won&#8217;t resolve it; and then they will run the game.  Before, this would have been a disaster; Subversion inserts annotations into text files to try to help humans manually resolve conflicts (this is an unfortunate throwback to programs like SCCS), which would have caused much of the world to fail to parse.  Now, though, the damage from these annotations is constrained to individual entities. It&#8217;s also easier to detect: if there is a conflict in the file for our Door #6555, then in addition to writing these annotations into 6555.entity_text (making it unparseable by the game), Subversion will also write out files 6555.entity_text.mine and 6555.entity_text.theirs, which contain the two intact but conflicting versions of the file.  The game can detect these very straightforwardly, put an error message on the HUD, and even choose one to load by default.  It is all very clean.</p>
<p>This is one of those interesting cases where reality-in-practice is starkly different from computer-science-in-theory.  In theory, a directory is just a data structure organizing a bunch of black-box data, and we happen to view this organization in a way that looks like a list of files; we could just do the same thing interior to our own file format, and it would be no big deal.  In practice, due to the way our tools work, these two arrangements are tremendously different.  The individual files just feel solid and reliable to work with, whereas one big structured file is always going to be precarious.</p>
<h2>Startup Procedure</h2>
<p>When the game starts up, we need to load all the entities from disk.  In the simplest case, this is straightforward: we just iterate through every file in the entities directory and load it.  However, as I mentioned, we wanted to keep a binary version of the entities that is preferred by the game if it exists and is up to date; partly, this might help startup speed a little (we don&#8217;t have to parse all these strings), but mainly, that is the file format and code path we are going to use when the game ships, and we don&#8217;t want that code to rot in the meantime.  Using it every day is the best way to prevent it from rotting.</p>
<p>So: when the game first starts up, we check for the binary entity package.  If it&#8217;s not there, we load all the individual entities files, then immediately save out the binary package.  (This binary package is a private, local file; if we were to add it to source control, everyone would always conflict with everyone else.)  But suppose we start up and the binary package is already there (which it usually will be).  We need then to determine if any of the textual entities have changed since the binary package was built.  The most-general way to do this is just by looking at the file timestamps; if we were to rely on some other signal being written to the disk that says &#8220;hey, entity data has changed,&#8221; then we would only be allowed to modify the entity files using sanctioned and customized tools; that would be annoying and would cause all kinds of robustness issues.</p>
<p>In concrete terms: we want to know the timestamp of the newest .entity_text file, inclusive of the directory containing these files (if we just did a Subversion update that only deleted entities, then all the .entity_text timestamps will be old, but the directory timestamp will be new; we want to ensure we properly rebuild the binary file in this case!)  To find the newest timestamp, we just iterate through all the timestamps in a brute-force way:</p>
<pre style="padding-left: 30px;">bool os_get_newest_file_modification_time(char *input_dir_name, Gamelib_Int64 *file_time_return) {
    //
    // We include the modification time of the directory as well.
    //

    char *dir_name = mprintf("%s/*", input_dir_name);
    Free_On_Return(dir_name);
    if (strlen(dir_name) &gt;= MY_MAX_PATH - 5) return false;

    //
    // best_time starts as the time for the directory (if it exists!)
    //
    Gamelib_Int64 best_time = 0;
    bool success = get_file_modification_time(input_dir_name, &amp;best_time);
    if (!success) {
        Log::print("Unable to get modification time for directory '%s'!\n", input_dir_name);
    }

    //
    // Now consider the file timestamps.
    //
    WIN32_FIND_DATA find_data;
    HANDLE handle = FindFirstFile(dir_name, &amp;find_data);
    if (handle == INVALID_HANDLE_VALUE) return false;

    while (1) {
        if (find_data.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY) {
        } else {
            Gamelib_Int64 file_time = to64(find_data.ftLastWriteTime);
            if (file_time &gt; best_time) best_time = file_time;
        }

        BOOL success = FindNextFile(handle, &amp;find_data);
        if (!success) break;
    }

    FindClose(handle);

    if (file_time_return) *file_time_return = best_time;

    return true;
}

bool get_file_modification_time(const char *name, Gamelib_Int64 *result_return) {
    HANDLE h = CreateFile(name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
                          NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY | FILE_FLAG_BACKUP_SEMANTICS,
                          NULL);
    if (h == INVALID_HANDLE_VALUE) return false;

    FILETIME write_time;
    GetFileTime(h, NULL, NULL, &amp;write_time);
    CloseHandle(h);

    if (result_return) *result_return = to64(write_time);
    return true;
}</pre>
<p style="padding-left: 30px;">&nbsp;</p>
<p>You&#8217;ll notice that this is Windows-specific code, but we don&#8217;t have to worry about porting it, because we only run the world editor on Windows.  Fortunately, in Windows, the file timestamp is right there in the directory data, so we don&#8217;t have to open each file.  (At least in NTFS this is true, rather than being an API illusion; the timestamps are stored in the Master File Table [MFT].)</p>
<p>What&#8217;s the performance like?  I typically run the game on two different machines: a high-performance Tower PC (CPU: Intel Core i7-970, hard drive: OCZ Vertex 3 SSD, RAM: 12GB) and a gaming Laptop (CPU: Intel Core i7-2820QM, hard drive: Intel SSD 500 [SSDSC2MH250A2], RAM: 12GB).</p>
<p>The time spent in os_get_newest_file_modification_time is:  Tower:<strong> .0095 sec, +/- .0015 sec</strong>; Laptop: <strong>.039 sec, +/- .005 sec</strong>.  (Timings were computed by averaging six trials, after a discarded warm-up run.)  This is definitely one of those cases where I&#8217;m glad I didn&#8217;t prematurely optimize, as I would have expected this to be much slower!</p>
<p>We typically install SSDs in all our work machines, but even when people have home machines that use spinning-platter hard drives, startup times are not much slower (likely due to the MFT data staying in cache).</p>
<p>If for a large enough number of entities this timestamp-gathering process becomes too slow, we can always write some code to read the timestamps out of the MFT directly, avoiding all the API call overhead, as in <a href="http://www.autoitscript.com/forum/topic/94269-mft-access-reading-parsing-the-master-file-table-on-ntfs-filesystems/">this forum posting</a>.  To date we&#8217;ve had no need to do this.</p>
<p>Some people have reported performance problems when Windows has more than 100,000 files in one directory, but this can be worked around: just make 10 directories, with IDs ending with each digit from 0-9 grouped in common directories.  (Why use the least-significant &#8220;ending&#8221; digit, rather than the most-significant &#8220;starting&#8221; digit, which might be the impulsive choice?  Because if you do it that way, <a href="http://en.wikipedia.org/wiki/Benford's_law">Benford&#8217;s Law</a> says your entities are likely to be unevenly distributed across the directories.  Why not just hash them into a folder?  Because it&#8217;s useful to be able to manually navigate to the entity you want, without searching.  (However, partitioning by least-significant digit may be inconvenient if you want to manually edit a sequential range of entities for some reason, because that range will span many directories.  If this is an important use case, perhaps there&#8217;s a good compromise like using the tens digit or hundreds digit &#8212; though I have the itching feeling that a clearly superior solution would exist.))</p>
<p>As things stand in terms of editing the game world, we are probably not yet at the peak entity count, but there&#8217;s unlikely to be more than 3x the number of entities we have now.  Given how low the timing measurements are now, it&#8217;s clear that performance will not be a factor in the ability to use this system up until shipping the game.</p>
<h2>Partitioning the ID Space</h2>
<p>As I mentioned, in our engine, entity IDs are integer serial numbers.  We like this because they are easy to type (we have to type them in the editor sometimes) and at runtime, looking up an entity compiles to a fast indexing of a flat array, with a bounds check.</p>
<p>This introduces another problem for us to deal with in world editing, though: we need to ensure that two users, who are both creating new entities, do not both try to use the same number.  This would result in both users attempting to add completely incompatible .entity_text files with the same name.</p>
<p>One obvious and bulletproof solution is to have the editor connect to the network and atomically grab an ID from a central server each time one is needed.  But again, we don&#8217;t want to require users to be on the network in order to edit.</p>
<p>My solution was a somewhat lazy one: we allocate a range of IDs to each computer that edits the world.  These are kept in a file called &#8220;id_ranges&#8221;; at startup time, the game queries its machine&#8217;s MAC address, then looks in the file for the corresponding ID range; if not found, it claims a new range and adds a new line to the file:</p>
<pre style="padding-left: 30px;"> 6000 10000 BC-AE-C5-66-28-E9 #Jonathan_office
10000 13000 BC-AE-C5-66-28-48 #Ignacio_office
13000 16000 00-1C-7B-75-00-D8 #Jonathan_laptop
16000 19000 BC-AE-C5-66-28-93 #Shannon_office
19000 22000 BC-AE-C5-56-42-51 #Jonathan_home
22000 25000 C0-3F-0E-AA-F3-F2 #icastano_home
25000 28000 F4-6D-04-1F-D4-36 #Shannon_home
28000 31000 Baker #Baker
31000 34000 BC-AE-C5-56-43-FE #Misc_PC_office
34000 37000 00-E0-81-B0-7A-A9 #eaa
37000 40000 00-21-00-A0-8F-E3 #Orsi
40000 43000 64-99-5D-FD-97-64 #Jonathan
43000 46000 08-86-3B-42-0B-8D #Misc
46000 49000 90-E6-BA-88-9B-B7 #andrewlackey
49000 52000 48-5B-39-8C-80-5E #eaa
52000 55000 50-E5-49-55-64-BF #facaelectrica
55000 58000 00-FF-D4-C7-15-A3 #facaelectrica
58000 70000 Clusters #Clusters
71000 75000 Overflow #Overflow
75000 78000 F4-6D-04-1F-CC-77 #Nacho
78000 81000 BC-AE-C5-74-7B-A3 #Thekla</pre>
<p>On each line, everything after the # is just a comment telling us in a human-readable way whose machine is responsible for that range (it defaults to the Windows username, but we can hand-edit that if we want).</p>
<p>(&#8220;Baker&#8221; is for an automated process, so I made a special case that uses the string &#8220;Baker&#8221; instead of the MAC address, just to minimize the potential for the build machine to claim a new range without us noticing and failing to check that in; see below.  &#8221;Clusters&#8221; is for an editor operation that is also run in an automated process, but which can also be done manually by anyone; cluster generation removes all previous clusters from the world, so if clusters didn&#8217;t have their own space, you would end up frequently deleting entities in other peoples&#8217; ranges; this seems like it might be a bad idea, though maybe, in reality, it&#8217;s fine and there would be no problem.  But as it stands we know that anything in the Clusters range is completely disposable, so if a conflict ever arises there we can just revert or delete those entities without a second thought.)</p>
<p>This ID space is naturally going to have a lot of big holes in it, but before we ship we will renumber the entities so that we can pack them tightly into an array.  In the meantime, it is sparse but not pathologically so; we can still get away with using a linear array to index the entities, though it will use more memory now than at ship.</p>
<p>This id_ranges file is a bit of a lazy solution, and it causes a few annoyances.  The most annoying thing is that, any time someone runs the editor for the first time on a new machine, they need to immediately check in the id_ranges file to publish their allocation to the rest of the team; and they need to coordinate so that nobody else is trying to do the same thing.  Because the editor just allocates the next 3000 IDs starting with the highest ID in the file, if two people try to allocate IDs simultaneously, they will both claim the same range.  We could solve this by requiring the editor to hold a source control lock to modify the id_ranges file, but I just haven&#8217;t gotten around to it, because this hasn&#8217;t been a big-enough problem.  Furthermore, we could have the editor automatically commit the changes to the file; but currently, nothing is ever published to the rest of the team automatically &#8212; publishing always requires manual action, and this seems like it may be a good thing to preserve.</p>
<p>But, not having implemented these solutions, we have been taken by surprise a couple of times by interactions with a second lazy choice of this system: the fact that we file only records one MAC address per computer.</p>
<p>Most modern computers have multiple MAC addresses (for example: if your computer has a Wifi adapter and two Ethernet ports, it&#8217;s probably got at least 3 MAC addresses).  My lazy code just asks Windows to iterate the MAC addresses and reports the first one for use in the file.  Sometimes, though, the reported address will change, which causes someone&#8217;s machine to modify the id_ranges file when they didn&#8217;t expect it; we had this problem once when an audio contractor, who works offsite, installed some VPN software.  If that user is not vigilant about source control (which non-technical people often aren&#8217;t), it can be a while before this problem is discovered; meanwhile, that user has been creating entities that may conflict with someone else&#8217;s.</p>
<p>Most or all occurrences of this problem could be solved by recording all of the user&#8217;s MAC addresses in the file, instead of one; I just haven&#8217;t done so.</p>
<p>If we weren&#8217;t using integer serial numbers, we wouldn&#8217;t really need id_ranges at all.  For example, if we looked up entities at runtime by hashing unique string identifiers, then we would only need to ensure that each user has a unique string prefix.  We take a slight overkill approach, where each entity ID is a somewhat long string starting with the user&#8217;s MAC address; or we could even generate a Windows GUID for each entity.  MAC addresses are 48 bits wide.  If you concatenate the MAC address with a 4-byte integer, that&#8217;s just 10 bytes per entity ID, which isn&#8217;t much (we currently use 4, already!).  Of course encoding these as strings and storing them in a hash table is going to require more space, but it isn&#8217;t ridiculous.  Looking things up in a hash table all the time is slower than indexing a flat array, so we are sticking with the way we do things for now; but this would solve some problems and simplify the overall system, so it sounds like the kind of decision I would change my mind on later, as computers get even faster than they currently are.  So if you implement a scheme like this, you can ignore everything I said about id_ranges.  The biggest problem becomes making it easy to type longer entity IDs into the in-game editor.</p>
<h2>Logistical Issues in Editor and File Format Design</h2>
<p>In closing, I want to discuss changes we made to the editor and file format, in order to make them compatible with the paradigm of concurrent editing.</p>
<h3>Arrays</h3>
<p>Just about every game wants to serialize arrays into files.  When transitioning from a binary format, the most natural thing for a performance-minded programmer is to write the array length out first, then write each member of the array.  That way, when reading the file back, we know how much memory to allocate, and we avoid all the slow things one has to do when reading an array of unknown length.  However, encoding arrays in this way results in a textual format that always conflicts, because even when people are making compatible edits to an array, nobody is going to agree on what that array count should be; also, it becomes impossible to manually edit conflicts without typing the count in: if two people add elements to an array, the merged array will contain all the items, but neither version of the file will contain the correct count!</p>
<p>To solve this, of course, we go to the common text-file convention of using a syntactic designation that an array is now over, rather than pre-declaring how many elements there are.  This is obvious, but I mention it here because it is a relatively universal concern.</p>
<h3>Automatic Changes</h3>
<p>You will also want to minimize or work around cases where the editor automatically changes entity properties without user intervention, because often these will lead to conflicts.  A simple example from our game world: the sun is represented by a few entities that are instantiated in the world, a glowing disc and a couple of particle systems.  Every frame, the gameplay code positions these entities with respect to the current camera transform so that, when the player moves around the world, the sun will seem to be infinitely far away.  This happens in the editor too, because when editing we want to see the world exactly the way it will look in-game.  So, as soon as we enabled concurrent editing, everyone was checking in different coordinates for the sun (depending on where the camera happened to be when they saved!) and this caused a lot of conflicts.  My first solution was to add a hack that zeroes the position of sun entities when saving, but upon loading, this interacted badly with the way particle systems interpolate their positions.  Instead, I added an entity flag that signifies that an entity&#8217;s pose doesn&#8217;t matter, with respect to thinking about whether it has changed or not, so we will only modify the sun&#8217;s .entity_text files if some more-important properties are modified.  (This article is already long, but I&#8217;ll say that in general, we detect differences between an entity&#8217;s current state and its state when it was loaded, and we only write out .entity_text files when properties have changed.)</p>
<h3>Relative Transforms</h3>
<p>In our engine, all entities have &#8216;position&#8217; and &#8216;orientation&#8217; properties, which always represent the entity&#8217;s frame in worldspace, flat and non-hierarchically.  If we want an entity to be attached to another entity&#8217;s transform, we set the properties &#8216;mount_parent_id&#8217;, &#8216;mount_position&#8217;, and &#8216;mount_orientation&#8217; (you can see all these properties in the listing for Door #6555 above); once per frame, the game engine computes the entity&#8217;s new worldspace transform based on its mount information, properly handling long dependency chains.  Once we started using textual entity files, we found that entities&#8217; worldspace coordinates would often differ by an LSB or two, even when their parents had not moved (differences especially happening, for example, between Debug and Release builds of the game).  Even without concurrent editing, it&#8217;s good to clean this up as a matter of basic hygiene, because otherwise you&#8217;re checking in spurious changes all the time, increasing load on the source control system and making it harder for a human to see useful information in the change list.  I chose to solve this problem by making the mount-update code more complex: it detects whether an entity has moved of its own accord, and only updates child entities&#8217; worldspace positions if the parent entity really moved (or if the child entity really moved!).</p>
<h3>Terrain Editing</h3>
<p>There is one piece of editing workflow that used to make sense before concurrent editing, but which now does not.  We have a terrain system wherein we can move control points around in worldspace, then select a terrain entity, which has a height-field mesh, and press a key to recompute that height field with respect to the new control points.  I originally made this recomputation happen only on manually-selected entities, rather than automatically on the entire world, for UI smoothness purposes: the recomputation takes some time.  But when you only recompute one block of terrain and not its neighbors, you get discontinuities in the terrain; the longer things go on, the more discontinuities you get.  Once in a while I would fix this by selecting all terrain entities in the world, recomputing them simultaneously.</p>
<div id="attachment_1454" class="wp-caption aligncenter" style="width: 522px"><a href="http://the-witness.net/news/wp-content/uploads/2011/12/discontinuity.png"><img class="size-large wp-image-1454" title="discontinuity" src="http://the-witness.net/news/wp-content/uploads/2011/12/discontinuity-512x322.png" alt="" width="512" height="322" /></a><p class="wp-caption-text">A terrain discontinuity</p></div>
<p>The catch is that when terrain changes, it affects other entities.  We re-plant grass, so that the grass matches the new elevations; we change the positions of trees and rocks and other objects that are rooted to the terrain at a predetermined height.  Whenever you recompute some terrain, we collect all grass/trees/rocks within a conservative bounding radius, as these are all the things that might possibly change.  When dealing with small groups of terrain blocks, this already is a bit of a recipe for trouble (it is not too hard to overlap someone else&#8217;s edits this way); but it also means that if I recompute the entire terrain to eliminate those discontinuities, I am in turn editing all grass, trees, and rocks in the world, and will inevitably conflict with anyone else who has moved any of them. For now, we simply shy away from this kind of global operation; when you get a conflict in some entity that you probably didn&#8217;t care about, like grass, it is easy just to accept the remote version of the file.  Long-term, I expect some kind of heavier-weight solution would have to happen here, though I hope it does not involve much locking.</p>
<h3>Issuing Source Control Commands</h3>
<p>Our editor automatically issues source control commands when entities are created or destroyed, because it would be extremely tedious and error-prone to expect users to do this.  Initially we had some problems with source control commands unexpectedly failing, which quickly leads to chaos.  After some work, issuing source control commands seems to work with full consistency, but we are still a little wary of it; so we don&#8217;t, for example, want to issue the commands via a background process, adding more complexity to the system.  The problem with this is that svn commands are a bit slow.  Sometimes when I have been editing the world for a while, it can take 15 to 30 seconds to save my changes, which would have happened instantaneously without the svn commands.</p>
<h2>Conclusion</h2>
<p>We&#8217;ve put together a system that lets us concurrently edit an open world, using source control to manage our world edits.  It works well enough for us to ship the game, so I am happy with it.  If the scheme ever fails in some way, or requires heavy modification, I will post an update!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/12/engine-tech-concurrent-world-editing/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Architecture in The Witness</title>
		<link>http://the-witness.net/news/2011/12/architecture-in-the-witness/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=architecture-in-the-witness</link>
		<comments>http://the-witness.net/news/2011/12/architecture-in-the-witness/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 21:28:02 +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=1389</guid>
		<description><![CDATA[This summer, we began working in earnest with architects, to bring further sophistication to the design of locations in The Witness.  Before this time, we had a game that was fully playable, but buildings and the areas around them tended to be placeholders, developed only enough to make the basic gameplay possible.  We began working [...]]]></description>
			<content:encoded><![CDATA[<p>This summer, we began working in earnest with architects, to bring further sophistication to the design of locations in The Witness.  Before this time, we had a game that was fully playable, but buildings and the areas around them tended to be placeholders, developed only enough to make the basic gameplay possible.  We began working with two architecture firms, FOURM design (for buildings and such), and David Fletcher Studio (for landscape architecture).  Both firms are located in the Bay Area, so it&#8217;s easy for us to meet regularly.</p>
<p>When we sat down to start working with the architects, one of the first things we did was put together a history of the island where The Witness takes place: how long has the island been there?  What groups of people lived there, and what kind of structures did they build?  How did later civilizations use the structures built by earlier groups?</p>
<p>Quickly we developed a running theme of sites that are old and have over time been used in two or three different ways.  When entering a new location, you probably first notice the most basic elements of its structure: where you can walk to easily, versus where you can&#8217;t; what puzzles or goals are calling for your attention, and what walls or doors might be preventing you from getting to them.  If this is all you care about, you can then play through the area in a very utilitarian fashion.  But if you have an eye for detail, you may notice the elements of modern construction shoring up the design of an older structure with a different purpose.  The design of the new structure tells you something about what the newer guys were doing there, and how it differs from what the older guys were doing there.  And if you look really closely, you can see traces of the original footprint of the site (perhaps these are very subtle, some bricks just rising above the dirt in a few places), and infer the purpose of this very old site too.</p>
<p>If you see the different civilizations that came to this island as embodying different philosophies; and you see the structures they built as representative of the way these philosophies led them to interact with the world; and you see further that when they replaced a site, it represents the rejection of some older worldview that they consider no longer useful, then perhaps you start to get some idea of the amount of backstory that can be encoded into the world, nonverbally.</p>
<p>All of this backstory is also directly relevant to the main story &#8212; who you are, why you are on this island, how you may get back home.  So, to put it another way, the game is constructed so that the more you pay attention to tiny details during your travels, the more insight you will have to the central story, even though it may not be obvious at any given time what a particular detail has to do with that story.</p>
<div>
<p>Having smart architecture, it seems, really helps this process work, brings it alive.  If you build a game where people are supposed to pay attention to details, but the details are wrong or naive or just don&#8217;t have much thought put into them, then at some level the game just won&#8217;t work.  Even if you don&#8217;t know the first thing about architecture, you have been in enough buildings in your life that the deeper parts of your brain have distilled plenty of patterns about those buildings.  Your brain knows the difference between a real building and a nonsense building that wouldn&#8217;t occur in the real world.  It can feel the difference in veracity between carefully-thought-out structural details &#8212; on the one hand &#8212; versus stuff that was just placed by a level designer to look cool.  When I showed a recent build to a friend, who had already played an earlier build of the game, he said the new structures made the game feel deeper, more serious.</p>
<p>I was a little surprised by this statement but should not have been, since really, that is what we are aiming for.  Thoughtful design of these structures and landscapes gives the game further gravitas.</p>
</div>
<div>
<p>The most-recent issue of Game Informer printed an article that showed some of the first screenshots of the newly-architected areas appearing in the game engine.  It is an interesting article; pick up the issue if you haven&#8217;t!  They also put up a companion article online (but which not as extensive) here:</p>
<p><a href="http://www.gameinformer.com/games/the_witness/b/pc/archive/2011/12/06/architecture-of-the-witness.aspx">(Summary article at Game Informer)</a></p>
<p>The area featured in this article is the one that we have taken furthest so far in terms of modeling and texturing.  Here are some other shots of it:</p>
<p style="text-align: center;"><strong>The Keep, before and after</strong></p>
<p style="text-align: center;"><strong><a href="http://the-witness.net/news/wp-content/uploads/2011/12/keep_before_and_after.png"><img class="aligncenter size-medium wp-image-1413" title="keep_before_and_after" src="http://the-witness.net/news/wp-content/uploads/2011/12/keep_before_and_after-300x89.png" alt="" width="300" height="89" /></a><br />
</strong></p>
<p style="text-align: center;"><strong>The Keep, close-up 1</strong></p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_32_n01.png"><img class="size-medium wp-image-1416 aligncenter" title="shot_2011.11.15__time_14_32_n01" src="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_32_n01-300x187.png" alt="" width="300" height="187" /></a><strong><br />
</strong></p>
<p style="text-align: center;"><strong>The Keep, close-up 2</strong></p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_33_n04.png"><img class="size-medium wp-image-1414 aligncenter" title="shot_2011.11.15__time_14_33_n04" src="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_33_n04-300x187.png" alt="" width="300" height="187" /></a><strong> </strong></p>
<p style="text-align: center;"><strong><br />
The Keep, close-up 3</strong></p>
<p style="text-align: center;"><strong><a href="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_35_n07.png"><img class="aligncenter size-medium wp-image-1415" style="border-style: initial; border-color: initial;" title="shot_2011.11.15__time_14_35_n07" src="http://the-witness.net/news/wp-content/uploads/2011/12/shot_2011.11.15__time_14_35_n07-300x187.png" alt="" width="300" height="187" /></a></strong></p>
<p style="text-align: center;"><strong><br />
</strong></p>
<p>We&#8217;ve done basic planning for some of the other areas, so I thought it would be nice to show some screenshots of work in progress.  For each of these, there&#8217;s a &#8216;before&#8217; version (when we had a fully-playable game, but basic placeholder structures) and after (once we have incorporated the architects&#8217; designs, revised the site plans and in some cases even the puzzles, etc):</p>
<p>&nbsp;</p>
<p style="text-align: center;"><strong>The Compound, before and after</strong></p>
<div><a href="http://the-witness.net/news/wp-content/uploads/2011/12/compound_before_and_after.png"><img class="size-medium wp-image-1399 aligncenter" style="border-style: initial; border-color: initial;" title="compound_before_and_after" src="http://the-witness.net/news/wp-content/uploads/2011/12/compound_before_and_after-300x84.png" alt="" width="300" height="84" /></a></div>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p style="text-align: center;"><strong><br />
Glass Factory, before and after</strong></p>
<p style="text-align: center;"><strong><a href="http://the-witness.net/news/wp-content/uploads/2011/12/glass_before_and_after.png"><img class="aligncenter size-medium wp-image-1400" title="glass_before_and_after" src="http://the-witness.net/news/wp-content/uploads/2011/12/glass_before_and_after-300x84.png" alt="" width="300" height="84" /></a><br />
</strong></p>
<p style="text-align: center;"><strong>Peninsula, before and after</strong></p>
<p style="text-align: center;"><strong><a href="http://the-witness.net/news/wp-content/uploads/2011/12/peninsula_before_and_after.png"><img class="aligncenter size-medium wp-image-1401" title="peninsula_before_and_after" src="http://the-witness.net/news/wp-content/uploads/2011/12/peninsula_before_and_after-300x84.png" alt="" width="300" height="84" /></a><br />
</strong></p>
<p style="text-align: center;"><strong>Vault, before and after</strong></p>
<p style="text-align: center;"><strong><a href="http://the-witness.net/news/wp-content/uploads/2011/12/vault_before_and_after.png"><img class="aligncenter size-medium wp-image-1402" title="vault_before_and_after" src="http://the-witness.net/news/wp-content/uploads/2011/12/vault_before_and_after-300x84.png" alt="" width="300" height="84" /></a><br />
</strong></p>
<p style="text-align: left;">Don&#8217;t regard these &#8220;after&#8221; images as representative of what the game will look like!  They are still works in progress, and the final game will look substantially better: scenes like these will feel richer due to the placement of detail objects, further care put into the texture mapping and lighting, refinement of the still-rough-drafty terrain features around these structures, and many other bits of subtle game development magic.  But I wanted to show these now since they provide a good taste of the game&#8217;s flavor, and they show how much structural intelligence is brought to the table by working with the architects.  Yes, we could have started with the placeholder structures and made them more elaborate and better-looking, in a general video-game-level-design way, but that&#8217;s different from having well-thought-out ideas subtly embodied in the structures of the areas, which is what we are going for.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/12/architecture-in-the-witness/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>My Screenshots folder</title>
		<link>http://the-witness.net/news/2011/12/my-screenshots-folder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-screenshots-folder</link>
		<comments>http://the-witness.net/news/2011/12/my-screenshots-folder/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 03:40:55 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1385</guid>
		<description><![CDATA[From time to time I take screenshots, to send in email to other team members, or for the architects&#8217; reference, etc.  Today I glanced at my desktop and noticed it looked pretty cool.  So here it is (with some shots, that seemed a bit too spoilery, redacted): &#160;]]></description>
			<content:encoded><![CDATA[<p>From time to time I take screenshots, to send in email to other team members, or for the architects&#8217; reference, etc.  Today I glanced at my desktop and noticed it looked pretty cool.  So here it is (with some shots, that seemed a bit too spoilery, redacted):</p>
<p>&nbsp;</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/12/screenshots.png"><img class="aligncenter size-medium wp-image-1386" title="screenshots" src="http://the-witness.net/news/wp-content/uploads/2011/12/screenshots-300x222.png" alt="" width="300" height="222" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/12/my-screenshots-folder/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>New game: Q.U.B.E. will be released on December 16th.</title>
		<link>http://the-witness.net/news/2011/11/new-game-q-u-b-e-will-be-released-on-december-16th/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-game-q-u-b-e-will-be-released-on-december-16th</link>
		<comments>http://the-witness.net/news/2011/11/new-game-q-u-b-e-will-be-released-on-december-16th/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 06:52:51 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Other Games]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1348</guid>
		<description><![CDATA[In addition to working on The Witness, I am a partner in the Indie Fund, a group of successful indies who finance imaginative indie games under developer-friendly terms. Our fund has been around for almost 2 years now, and I am happy to announce that our first funded game is about to be released. It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to working on The Witness, I am a partner in the Indie Fund, a group of successful indies who finance imaginative indie games under developer-friendly terms.  Our fund has been around for almost 2 years now, and I am happy to announce that our first funded game is about to be released.  It&#8217;s a first-person puzzle game called Q.U.B.E., made by some guys in England called Toxic Games.  They are just out of school, this is their first game, and they managed to make it without a programmer!</p>
<p><a href="http://www.youtube.com/watch?v=iABxhj0ExA0"><img src="http://img.youtube.com/vi/iABxhj0ExA0/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=iABxhj0ExA0">Click here</a> to view the video on YouTube.</p>

<p>&nbsp;</p>
<p>Q.U.B.E. will be available on <a href="http://store.steampowered.com/">Steam</a>.</p>
<p><a href="http://qube-game.com">(Web site for the game)</a></p>
<p><a href="http://indie-fund.com/2011/11/q-u-b-e-is-first-indie-fund-game-to-be-released/">(Indie Fund announcement page)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/11/new-game-q-u-b-e-will-be-released-on-december-16th/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Update!</title>
		<link>http://the-witness.net/news/2011/11/update-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=update-2</link>
		<comments>http://the-witness.net/news/2011/11/update-2/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 02:25:15 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1344</guid>
		<description><![CDATA[I am working hard on puzzles right now. We&#8217;ve had figured out, for a while, the basic set of locations you can travel to on the island, and what the puzzles are in each. These locations were defined to varying degrees of specificity, though. Sometimes we know what the puzzles are, exactly (they are all [...]]]></description>
			<content:encoded><![CDATA[<p>I am working hard on puzzles right now.  We&#8217;ve had figured out, for a while, the basic set of locations you can travel to on the island, and what the puzzles are in each.  These locations were defined to varying degrees of specificity, though.  Sometimes we know what the puzzles are, exactly (they are all designed and implemented) but aren&#8217;t sure what the architecture is.  Sometimes I have concrete ideas for some puzzles but only vague ideas for other puzzles, and it&#8217;s a case of &#8220;I will fill these in later on, when I have time to think about it and come up with something good here; but it is pretty clear to me that there <em>will</em> be something good here, so I am not worrying too much about it.&#8221;</p>
<p>Eventually, these things have to be figured out.  Over the past month or so we&#8217;ve done some of that figuring.  We nailed down the architecture for a couple of areas (including the all-important area where the player starts the game).  We&#8217;ve done this in a way where the architecture and the puzzle ideas have synergy, which is always nice.  In particular, there was one location that, from the beginning of development, was basically a big box with a window cut into it and some puzzles stuffed inside.  For a long time (maybe 2 years!) I was never sure what to do with it, but eventually the architects suggested an idea for that location.  I mocked it up and didn&#8217;t like it.  They suggested another one.  This one sparked an idea for how to make the structural properties resonate with the puzzle theme, and when I built even just a rough-draft of the building, I found the result to be strong.  Lately we&#8217;ve been finalizing that location too.</p>
<p>So anyway, there are all these spots on the island that represented vague ideas, with puzzles there that were just in rough form, or that weren&#8217;t even implemented fully, but just served as reminders to do something there.  I&#8217;ve been going through and filling in a bunch of those.  </p>
<p>I have also been working with some other puzzles, which seemed &#8220;done enough to ship&#8221;, and thinking hard about how to make them better.  Braid benefited from a lot of this kind of attention &#8212; a lot of games would have shipped with just early versions of the puzzles in that game, considering them to be just fine; but the more I worked with the puzzles in Braid, the more I found better, simpler, more-to-the-point versions of them.  The same thing is happening here (though The Witness is a much bigger, more-complicated game, so sometimes it is challenging to get to that same kind of clarity.)</p>
<p>With regard to the visuals (modeling and texturing), things have been coming along nicely as well.  Pretty soon a high-profile game magazine will publish some screenshots of one of the most-finished areas of the game, showing the look we are targeting and giving a strong hint of what the game will be like stylistically.  When the magazine is out there we will link it here.</p>
<p><em>(This has not been a particularly coherent update; just wanted to let you all know what is up!)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/11/update-2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Designing to Reveal the Nature of the Universe</title>
		<link>http://the-witness.net/news/2011/11/designing-to-reveal-the-nature-of-the-universe/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=designing-to-reveal-the-nature-of-the-universe</link>
		<comments>http://the-witness.net/news/2011/11/designing-to-reveal-the-nature-of-the-universe/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 05:58:09 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Other Games]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1338</guid>
		<description><![CDATA[This talk was presented by Jonathan Blow and Marc ten Bosch at Indiecade on October 7, 2011. Any system of interactivity can of course be explored: If X happens, what are the consequences? What are all the ways in which pattern Y expresses itself, and to what do those expressions lead? By inspecting the structure [...]]]></description>
			<content:encoded><![CDATA[<p>This talk was presented by Jonathan Blow and Marc ten Bosch at Indiecade on October 7, 2011.</p>
<p><center><br />
<iframe width="420" height="315" src="http://www.youtube.com/embed/OGSeLSmOALU" frameborder="0" allowfullscreen></iframe></center></p>
<p><em>Any system of interactivity can of course be explored: If X happens, what are the consequences? What are all the ways in which pattern Y expresses itself, and to what do those expressions lead? By inspecting the structure of a system in this way, we can find the core ideas of the system, and see how those ideas illustrate fundamental truths of our universe. We present a game design aesthetic that values looking for systems that express these truths in the cleanest possible way. We explain how this is different from more-traditional combinatoric design techniques; we show examples from our games and describe a method for applying the aesthetic in general.</em></p>
<p><a href="http://www.indiecade.com/index.php/2011/Conference_videos/">Here&#8217;s a link to the Indiecade page, on which there&#8217;s also a presentation by Richard LeMarchand, and more to come.</a></p>
<p><em>Thanks very much to <a href="http://portfolio.idaimages.com/">Ida C. Benedetto</a> for recording the talk!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/11/designing-to-reveal-the-nature-of-the-universe/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>Saying hi.</title>
		<link>http://the-witness.net/news/2011/10/saying-hi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=saying-hi</link>
		<comments>http://the-witness.net/news/2011/10/saying-hi/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 06:05:31 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1335</guid>
		<description><![CDATA[Hi everyone. We haven&#8217;t posted anything in a while, but this is just because we have been working intensively on the game. These days we are doing a lot of working with the architects, integrating their designs with the gameplay. The result is coming out really well &#8212; the architectural designs add tremendously to the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone.  We haven&#8217;t posted anything in a while, but this is just because we have been working intensively on the game.  These days we are doing a lot of working with the architects, integrating their designs with the gameplay.  The result is coming out really well &#8212; the architectural designs add tremendously to the feeling of being in a world, and they also give us opportunities to make the puzzles richer.  So as we do this the game just keeps getting bigger and more sophisticated.</p>
<p>I&#8217;ll post something more concrete before too long, but I wanted to at least say something, since it&#8217;s been a while.</p>
<p>Team-wise, we have just hired two people (a 3D artist and a programmer), and we plan to hire another programmer as well, once his visa clears and he can get into the country.  This is a pretty big staffing-up, percentage-wise, and will allow us to make things quite nice.  The new folks will be starting over the next couple of months (they need to wind down the things they are working on currently!)</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/10/saying-hi/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Island Snapshot</title>
		<link>http://the-witness.net/news/2011/09/island-snapshot-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-snapshot-3</link>
		<comments>http://the-witness.net/news/2011/09/island-snapshot-3/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 00:27:34 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1327</guid>
		<description><![CDATA[It&#8217;s been a while since we did one of these: The current puzzle count is 350. Some parts of the island are pretty messed up in this screenshot. For the press tour, we made sure the whole game was more-or-less solid and playable. Just after that, though, we were free to tear things apart, move [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since we did one of these:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/09/shot_2011.09.17__time_17_22_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/09/shot_2011.09.17__time_17_22_n01-300x168.png" alt="" title="shot_2011.09.17__time_17_22_n01" width="300" height="168" class="aligncenter size-medium wp-image-1328" /></a></p>
<p>The current puzzle count is 350.</p>
<p>Some parts of the island are pretty messed up in this screenshot.  For the press tour, we made sure the whole game was more-or-less solid and playable.  Just after that, though, we were free to tear things apart, move things around, change the sizes of areas, add new areas, and all that.  We&#8217;re still in the middle of that process and not everything has been made playable again.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/09/island-snapshot-3/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Interview on GameSpot&#8217;s HotSpot podcast</title>
		<link>http://the-witness.net/news/2011/09/interview-on-gamespots-hotspot-podcast/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=interview-on-gamespots-hotspot-podcast</link>
		<comments>http://the-witness.net/news/2011/09/interview-on-gamespots-hotspot-podcast/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 22:55:28 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1324</guid>
		<description><![CDATA[GameSpot&#8217;s podcast, HotSpot, had Jonathan Blow as a guest for the September 14th episode. There&#8217;s a bit of an interview, and chatting about various game topics; some discussion of Braid, some of The Witness, and what makes a good puzzle? Here&#8217;s the link.]]></description>
			<content:encoded><![CDATA[<p>GameSpot&#8217;s podcast, HotSpot, had Jonathan Blow as a guest for the September 14th episode.  There&#8217;s a bit of an interview, and chatting about various game topics; some discussion of Braid, some of The Witness, and what makes a good puzzle?</p>
<p><a href="http://www.gamespot.com/pages/features/hotspot/index.php?id=2662">Here&#8217;s the link.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/09/interview-on-gamespots-hotspot-podcast/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A pleasant lightmapping update</title>
		<link>http://the-witness.net/news/2011/09/a-pleasant-lightmapping-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-pleasant-lightmapping-update</link>
		<comments>http://the-witness.net/news/2011/09/a-pleasant-lightmapping-update/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 22:22:16 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1317</guid>
		<description><![CDATA[It&#8217;s been a little bit since the last post. We have been busy doing a lot of good things with the game. Here&#8217;s one of them: Ignacio just got back from vacation and implemented a simple lightmap encoding idea that improves the color resolution of our lightmaps, removing banding, like so: The difference is not [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a little bit since the last post.  We have been busy doing a lot of good things with the game.  Here&#8217;s one of them: Ignacio just got back from vacation and implemented a simple lightmap encoding idea that improves the color resolution of our lightmaps, removing banding, like so:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/09/before_after.jpg"><img class="aligncenter size-medium wp-image-1318" title="before_after" src="http://the-witness.net/news/wp-content/uploads/2011/09/before_after-300x168.jpg" alt="" width="300" height="168" /></a></p>
<p>The difference is not too pronounced in this scene, but with smoother-colored textures it becomes a lot more obvious (and I do want to use more smoother-colored textures, art-direction-wise!)</p>
<p>The situation is, the lightmaps are HDR (for some definition of &#8220;high&#8221;), so we needed a way to encode those values reasonably into a bitmap.  We were using RGBM where M is just an overall brightness factor; you read RGB from the texture then multiply by M to get the output color.  We used to just encode this naively, but the problem is, when M is less than 1 then it actually kills precision in your RGB, so the solution is, well, don&#8217;t ever let M go below 1; just clamp it.  This is not rocket science and in fact is the kind of thing that is a little funny, as one starts wondering why we didn&#8217;t think of that a long time ago, but hey, that&#8217;s how it is sometimes.  The results made me happy, though, so I am posting them.</p>
<p>The improved image quality may enable us to have higher dynamic range throughout the game (this is probably something we will evaluate later on), which would be very nice!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/09/a-pleasant-lightmapping-update/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>A podcast with some background details&#8230;</title>
		<link>http://the-witness.net/news/2011/08/a-podcast-with-some-background-details/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-podcast-with-some-background-details</link>
		<comments>http://the-witness.net/news/2011/08/a-podcast-with-some-background-details/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 04:17:26 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1310</guid>
		<description><![CDATA[Back during the press tour, Michael Abbott invited me to come onto the Brainy Gamer Podcast, and the resulting episode is now live. It&#8217;s got some inside-baseball stuff that hasn&#8217;t been talked about in the press coverage. So that&#8217;s something. See also the previous episodes with Manveer Heir and Matthew Burns.]]></description>
			<content:encoded><![CDATA[<p>Back during the press tour, Michael Abbott invited me to come onto the Brainy Gamer Podcast, and <a href="http://www.brainygamer.com/the_brainy_gamer/2011/08/brainy-gamer-podcast-episode-35-pt-3.html">the resulting episode is now live</a>.  It&#8217;s got some inside-baseball stuff that hasn&#8217;t been talked about in the press coverage.  So that&#8217;s something.  See also the previous episodes with Manveer Heir and Matthew Burns.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/08/a-podcast-with-some-background-details/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Previews of The Witness are now out there.</title>
		<link>http://the-witness.net/news/2011/08/previews-of-the-witness-are-now-out-there/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=previews-of-the-witness-are-now-out-there</link>
		<comments>http://the-witness.net/news/2011/08/previews-of-the-witness-are-now-out-there/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 17:08:35 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1288</guid>
		<description><![CDATA[For the past couple of weeks I&#8217;ve been showing a preview version of The Witness to various folks in the press who were interested. Typically I just have them sit down and play for a couple of hours, from the beginning, with no guidance from me; afterward, we talk about what they just played. Previews [...]]]></description>
			<content:encoded><![CDATA[<p>For the past couple of weeks I&#8217;ve been showing a preview version of <em>The Witness</em> to various folks in the press who were interested.  Typically I just have them sit down and play for a couple of hours, from the beginning, with no guidance from me; afterward, we talk about what they just played.</p>
<p>Previews of the game are now being published, and readers of this blog have been asking for gameplay details for a while.  So it seems like a good idea to list the previews here.  I&#8217;ll keep updating this post as I find more.</p>
<ul>
<a href="http://kotaku.com/5828705/two-hours-with-jonathan-blows-the-witness-an-abbreviated-wonder">on Kotaku, by Stephen Totilo</a><br />
<a href="http://www.joystiq.com/2011/08/08/the-witness-preview/">on Joystiq, by Ben Gilbert</a><br />
<a href="http://www.gamespot.com/pc/puzzle/thewitnessnextgen/news/6327782/the-witness-preview?sid=6327782&#038;mode=previews">on Gamespot, by Sophia Tong</a><br />
<a href="http://pc.ign.com/articles/118/1186713p1.html">on IGN, by Anthony Gallegos</a><br />
<a href="http://www.gamasutra.com/view/feature/6451/bearing_witness.php">on Gamasutra, by Christian Nutt</a><br />
<a href="http://www.1up.com/previews/witness-longform-game-from-guy-made-braid">on 1UP, by Matt Leone</a><br />
<a href="http://www.gamesradar.com/xbox360/the-witness/preview/the-witness-hands-on-preview-braid-creators-new-game-is-myst-mensa-and-a-whole-lot-of-meta/a-201108081005106031/g-20100907104014643091">on GamesRadar, by Charlie Barratt</a><br />
<a href="http://www.giantbomb.com/news/a-rough-sketch-the-witness/3569/">on Giant Bomb, by Ryan Davis</a><br />
<a href="http://www.giantbomb.com/news/unraveling-the-witness-with-jonathan-blow/3572/">on Giant Bomb, by Patrick Klepek (interview-ish)</a><br />
<a href="http://techland.time.com/2011/08/11/playing-the-witness-hands-on-with-the-next-game-from-the-creator-of-braid/">on Time Techland, by Evan Narcisse</a><br />
<a href="http://www.ifc.com/news/2011/08/jonathan-blow-and-the-witness-1.php">on IFC, by Evan Narcisse (interview)</a><br />
<a href="http://www.rockpapershotgun.com/2011/08/12/the-witness-hands-on/">by Dan Griliopoulos on Rock, Paper, Shotgun</a></p>
<p><a href="http://www.gamesradar.com/f/jonathan-blow-interview-how-to-fix-the-adventure-innovate-mainstream-games-and-do-a-sequel-right/a-20110809142133844060">interview with GamesRadar</a><br />
<a href="http://oxmonline.com/article/features/-presses/braid-creator-speaks?page=0%2C0">interview with Cory Cohen of OXM</a><br />
<a href="http://www.rockpapershotgun.com/2011/08/15/jonathan-blow-interview/">long interview with Dan Griliopoulos of Rock, Paper, Shotgun (contains a bunch of stuff not elsewhere)<br />
</a><br />
<a href="http://www.eurogamer.net/articles/2011-08-30-jonathan-blow-interview">interview with Christian Donlan of Eurogamer</a>
</ul>
<p><em>(Sometimes these previews, from the way they are worded, make it seem like I made the entire game with my own bare hands.  That is not the case; it&#8217;s just how this kind of article tends to sound.  There are a number of people working on this game, who have creative input in various ways; see the About page for a partial list!)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/08/previews-of-the-witness-are-now-out-there/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Irradiance Caching &#8211; Part 1</title>
		<link>http://the-witness.net/news/2011/07/irradiance-caching-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=irradiance-caching-part-1</link>
		<comments>http://the-witness.net/news/2011/07/irradiance-caching-part-1/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 08:21:15 +0000</pubDate>
		<dc:creator>Ignacio Castaño</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=245</guid>
		<description><![CDATA[This is the first article I wanted to publish when I started writing about the technology behind The Witness. I had just spent a week or so implementing irradiance caching with rotation and translation gradients. Extending the equations of the gradient estimation to the hemicube sample distribution had proven to be tricky and had taken [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first article I wanted to publish when I started writing about the technology behind <a href="http://the-witness.net">The Witness</a>. I had just spent a week or so implementing irradiance caching with rotation and translation gradients. Extending the equations of the gradient estimation to the hemicube sample distribution had proven to be tricky and had taken me a considerable amount of effort. So, I thought it would be cool to document my derivation, so that others would not have to do the same. However, for that article to make sense I first had to provide some background, hence the previous two articles:</p>
<ul>
<li><a href="http://the-witness.net/news/?p=120">Lightmap Parameterization</a></li>
<li><a href="http://the-witness.net/news/?p=244">Hemicube Rendering and Integration</a></li>
</ul>
<p>Unfortunately, by the time I was done with these, the work I had done on the gradients was not so fresh anymore, which is why it has taken me so long to complete this article.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/irradiance_gradients_0.jpg"><img class="aligncenter size-large wp-image-1133" src="http://the-witness.net/news/wp-content/uploads/2011/06/irradiance_gradients_0-512x288.jpg" alt="" width="512" height="288" /></a><span id="more-245"></span></p>
<p>In <a href="http://the-witness.net/news/?p=244">my previous post</a> I mentioned the need to find an algorithm that would allow us to extrapolate the irradiance to fill lightmap texels with invalid samples, to smooth the resulting lightmaps to reduce noise, and to sample the irradiance at a lower frequency to improve performance. As some avid readers suggested <em>Irradiance Caching</em> solves all these problems. However, at the time I didn&#8217;t know that, and my initial attempts at a solution were misguided.</p>
<h2>Texture Space Approaches</h2>
<p>I had some experience writing baker tools to capture normal and displacement maps from high resolution meshes. In that setting it is common to use various image filters to fill holes caused by sampling artifacts and extend sampled attributes beyond the boundaries of the mesh parameterization. <a href="http://freespace.virgin.net/hugo.elias/radiosity/radiosity.htm">Hugo Elias&#8217; popular article</a> also proposes a texture space hierarchical sampling method, and that persuaded me that working in texture space would be a good idea.</p>
<p>However, in practice texture space methods had many problems. Extrapolation filters only provide accurate estimates close to chart boundaries, and even then, they only use information from one side of the boundary, which usually results in seams. Also, the effectiveness of irregular sampling and interpolation approaches in texture space is greatly reduced by texture discontinuities and did not reduce the number of samples as much as desired.</p>
<p>After trying various approaches, it became clear that the solution was to work in object space instead. I was about to implement my own solution, when I learned that this is what irradiance caching was about.</p>
<h2>Irradiance Caching</h2>
<p>This technique has such a terrible name that I would have never learned about it if it wasn&#8217;t due to a friend&#8217;s suggestion. I think that a much more appropriate name would be adaptive irradiance sampling or irradiance interpolation. In fact, in the <a href="http://radsite.lbl.gov/radiance/papers/sg88/paper.html">paper that introduced the technique for the first time</a> Greg Ward referred to it as <em>lazy irradiance evaluation</em>, which seems to me a much more appropriate name.</p>
<p>There&#8217;s plenty of literature on the subject and I don&#8217;t want to repeat what you can learn elsewhere. So, in this article I&#8217;m only going to provide a brief overview, focus on the unique aspects of our implementation, and point you to other sources for further reference.</p>
<p>The basic idea behind irradiance caching is to sample the irradiance adaptively based on a metric that predicts changes in the irradiance due to proximity to occluders and reflectors. This metric is based on the split sphere model, which basically models the worst possible illumination conditions in order to predict the necessary distance between irradiance samples based on their distance to the surrounding geometry.</p>
<p>Interpolation between these samples is then performed using radial basis functions, the radius associated to each sample is also based on this distance. Whenever the contribution of the nearby samples falls below a certain threshold a new irradiance record needs to be generated, in our case this is done by rendering an hemicube at that location. In order to perform interpolation efficiently the irradiance records are inserted in an octree, which allows us to efficiently query the nearby records at any given point.</p>
<p>For more details, the <a href="http://cgg.mff.cuni.cz/~jaroslav/papers/2008-irradiance_caching_class/index.htm">Siggraph &#8217;08 course</a> on the topic is probably the most comprehensive reference. There&#8217;s also a book based on the materials of the course; it&#8217;s slightly augmented, but in my opinion it does not add much value to the freely available material.</p>
<p>The <a href="http://www.pbrt.org/"><em>Physically Based Rendering book</em> by Matt Pharr &amp; Greg Humphreys</a> is an excellent resource and the <a href="https://github.com/mmp/pbrt-v2">accompanying source code</a> contains a good, albeit basic implementation.</p>
<p>Finally, Rory Driscoll provides a good introduction from a programmer&#8217;s point of view: <a href="http://www.rorydriscoll.com/2009/01/18/irradiance-caching-part-1/">part 1</a>, <a href="http://www.rorydriscoll.com/2009/01/24/irradiance-caching-part-2/">part 2</a>.</p>
<p>Our implementation is fairly standard, there are however a two main differences: First, we are sampling the irradiance using hemicubes instead of a stratified Montecarlo distribution. As a result, the way the we compute the irradiance gradients for interpolation is somewhat different. Second, we use a record placement strategy more suited to our setting. In part 1 I&#8217;ll focus on the estimation of the irradiance gradients, while in part 2 I&#8217;ll write about our record placement strategies.</p>
<h2>Irradiance Gradients</h2>
<p>When interpolating our discrete irradiance samples using radial basis functions the resulting images usually have spotty or smudgy appearance. This can be mitigated by increasing the number of samples and increasing the interpolation threshold, which effectively makes them overlap and smoothes out the result. However, this also increases the number of samples significantly, which defeats the purpose of using irradiance caching.</p>
<p>One of the most effective approaches to improve the interpolation is estimating the irradiance gradients at the sampling points, which basically tell how the irradiance changes when the position and orientation of the surface changes. We cannot evaluate the irradiance gradients exactly, but we can find reasonable approximations with the information that we already have from rendering an hemicube. </p>
<p>In my previous article I explained that the irradiance integral was just a weighted sum over the radiance samples, where the contribution of each sample is the product of the radiance through each of the hemicube texels <img src='http://s.wordpress.com/latex.php?latex=L_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='L_i' title='L_i' class='latex' />, the solid angle of the texel <img src='http://s.wordpress.com/latex.php?latex=A_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='A_i' title='A_i' class='latex' />, and the cosine term <img src='http://s.wordpress.com/latex.php?latex=%5Ccos_%7B%5Ctheta_i%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\cos_{\theta_i}' title='\cos_{\theta_i}' class='latex' />. That is, the irradiance <img src='http://s.wordpress.com/latex.php?latex=E%28%5Cmathbf%7Bx%7D%29&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='E(\mathbf{x})' title='E(\mathbf{x})' class='latex' /> at a point <img src='http://s.wordpress.com/latex.php?latex=%5Cmathbf%7Bx%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\mathbf{x}' title='\mathbf{x}' class='latex' /> is approximated as:</p>
<img src='http://s.wordpress.com/latex.php?latex=E%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%20%5Csum_%7Bi%3D0%7D%5EN%20A_i%20L_i%20%5Ccos%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='E(\mathbf{x}) \simeq \sum_{i=0}^N A_i L_i \cos\theta_i' title='E(\mathbf{x}) \simeq \sum_{i=0}^N A_i L_i \cos\theta_i' class='latex' />
<p>The irradiance gradients consider how each these terms change under infinitesimal rotations and translations and can be obtained by differentiating <img src='http://s.wordpress.com/latex.php?latex=E%28%5Cmathbf%7Bx%7D%29&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='E(\mathbf{x})' title='E(\mathbf{x})' class='latex' />.</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla%20E%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%20%5Csum_%7Bi%3D0%7D%5EN%20%5Cnabla%20A_i%20L_i%20%5Ccos%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N \nabla A_i L_i \cos\theta_i' title='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N \nabla A_i L_i \cos\theta_i' class='latex' />
<p>The radiance term is considered to be constant, so the equation reduces to:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla%20E%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%20%5Csum_%7Bi%3D0%7D%5EN%20L_i%20%5Cnabla%20A_i%20%5Ccos%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N L_i \nabla A_i \cos\theta_i' title='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N L_i \nabla A_i \cos\theta_i' class='latex' />
<p>In reality, the radiance is not really constant, but the goal is to estimate the gradients without using any information in addition to what we have already obtained by rendering the scene on a hemicube. So that we can improve the quality of the interpolation by only doing some additional computations while integrating the hemicube.</p>
<h3>Rotation Gradient</h3>
<p>The rotation gradient expresses how the irradiance changes as the hemicube is rotated in any direction:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla_r%20E%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%20%5Csum_%7Bi%3D0%7D%5EN%20L_i%20%5Cnabla_r%20A_i%20%5Ccos%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla_r E(\mathbf{x}) \simeq \sum_{i=0}^N L_i \nabla_r A_i \cos\theta_i' title='\nabla_r E(\mathbf{x}) \simeq \sum_{i=0}^N L_i \nabla_r A_i \cos\theta_i' class='latex' />
<p>The most important observation is that as the hemicube rotates, the solid angle of the texels with respect to the origin remains constant. So, the only factor that influences the gradient is the cosine term:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla_r%20A_i%20%5Ccos%5Ctheta_i%20%3D%20A_i%20%5Cnabla_r%20%5Ccos%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla_r A_i \cos\theta_i = A_i \nabla_r \cos\theta_i' title='\nabla_r A_i \cos\theta_i = A_i \nabla_r \cos\theta_i' class='latex' />
<p>With this in mind, the rotation gradient is simply the rotation axis scaled by the rate of change, that is, the angle gradient:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B%5Cpartial%20%7D%7B%5Cpartial%20%5Ctheta_i%7D%20%5Ccos%5Ctheta_i%20%3D%20-%5Csin%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\frac{\partial }{\partial \theta_i} \cos\theta_i = -\sin\theta_i' title='\frac{\partial }{\partial \theta_i} \cos\theta_i = -\sin\theta_i' class='latex' />
<p>And the rotation axis is given by the cross product of the z axis and the texel direction <img src='http://s.wordpress.com/latex.php?latex=%5Cmathbf%7Bd%7D_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\mathbf{d}_i' title='\mathbf{d}_i' class='latex' />:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cmathbf%7Bv%7D_i%20%3D%20%5Cleft%7C%20%5Cmathbf%7Bd%7D_i%20%5Ctimes%20%280%2C%200%2C%201%29%20%5Cright%7C&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\mathbf{v}_i = \left| \mathbf{d}_i \times (0, 0, 1) \right|' title='\mathbf{v}_i = \left| \mathbf{d}_i \times (0, 0, 1) \right|' class='latex' />
<p>Therefore:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla_r%20%5Ccos%5Ctheta_i%20%3D%20-%5Cmathbf%7Bv%7D_i%20%5Csin%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla_r \cos\theta_i = -\mathbf{v}_i \sin\theta_i' title='\nabla_r \cos\theta_i = -\mathbf{v}_i \sin\theta_i' class='latex' />
<p>This can be simplified further by noting that <img src='http://s.wordpress.com/latex.php?latex=%5Csin%5Ctheta_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\sin\theta_i' title='\sin\theta_i' class='latex' /> is the length of <img src='http://s.wordpress.com/latex.php?latex=%5Cmathbf%7Bv%7D_i&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\mathbf{v}_i' title='\mathbf{v}_i' class='latex' /> before normalization and that results in a very simple expression:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla_r%20%5Ccos%5Ctheta_i%20%3D%20%28%5Cmathbf%7Bd%7D_%7Byi%7D%2C%20-%5Cmathbf%7Bd%7D_%7Bxi%7D%2C%200%29&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla_r \cos\theta_i = (\mathbf{d}_{yi}, -\mathbf{d}_{xi}, 0)' title='\nabla_r \cos\theta_i = (\mathbf{d}_{yi}, -\mathbf{d}_{xi}, 0)' class='latex' />
<p>Finally, the rotation gradient for the hemisphere is the sum of the gradients corresponding to each texel.</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla%20E%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%20%5Csum_%7Bi%3D0%7D%5EN%20L_i%20A_i%20%28%5Cmathbf%7Bd%7D_%7Byi%7D%2C%20-%5Cmathbf%7Bd%7D_%7Bxi%7D%2C%200%29&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N L_i A_i (\mathbf{d}_{yi}, -\mathbf{d}_{xi}, 0)' title='\nabla E(\mathbf{x}) \simeq \sum_{i=0}^N L_i A_i (\mathbf{d}_{yi}, -\mathbf{d}_{xi}, 0)' class='latex' />
<p>The resulting code is trivial:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">foreach texel, color in hemicube <span style="color: #008000;">&#123;</span>
    Vector2 v <span style="color: #000080;">=</span> texel.<span style="color: #007788;">solid_angle</span> <span style="color: #000040;">*</span> Vector2<span style="color: #008000;">&#40;</span>texel.<span style="color: #007788;">dir</span>.<span style="color: #007788;">y</span>, <span style="color: #000040;">-</span>texel.<span style="color: #007788;">dir</span>.<span style="color: #007788;">x</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    rotation_gradient<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> v <span style="color: #000040;">*</span> color.<span style="color: #007788;">x</span><span style="color: #008080;">;</span>
    rotation_gradient<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> v <span style="color: #000040;">*</span> color.<span style="color: #007788;">y</span><span style="color: #008080;">;</span>
    rotation_gradient<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> v <span style="color: #000040;">*</span> color.<span style="color: #007788;">z</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<h3>Translation Gradients</h3>
<p>The derivation of the translation gradients is a bit more complicated than the rotation gradients because the solid angle term is not invariant under translations anymore.</p>
<p>My first approach was to simplify the expression of the solid angle term by using an approximation that is easier to differentiate. Instead of using the exact texel solid angle like I had been doing so far, I approximated it by the differential solid angle scaled by the constant area of the texel, which is a reasonable approximation if the texels are sufficiently small.</p>
<p>In general, the differential solid angle in a given direction <img src='http://s.wordpress.com/latex.php?latex=%5CTheta&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\Theta' title='\Theta' class='latex' /> is given by:</p>
<img src='http://s.wordpress.com/latex.php?latex=d%5Comega_%5CTheta%20%3D%20%5Cfrac%7B%5Cmathbf%7Bn%7D%5Ccdot%5CTheta%7D%7Br%5E2%7D%20da&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='d\omega_\Theta = \frac{\mathbf{n}\cdot\Theta}{r^2} da' title='d\omega_\Theta = \frac{\mathbf{n}\cdot\Theta}{r^2} da' class='latex' />
<p>For the particular case of the texels of the top face of the hemicube, <strong>n</strong> is equal to the z axis. So, the differential solid angle is:</p>
<img src='http://s.wordpress.com/latex.php?latex=d%5Comega_%5CTheta%20%3D%20%5Cfrac%7B%5Ccos%5Ctheta%7D%7Br%5E2%7D%20da&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='d\omega_\Theta = \frac{\cos\theta}{r^2} da' title='d\omega_\Theta = \frac{\cos\theta}{r^2} da' class='latex' />
<p>We also know that:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Ccos%5Ctheta%20%3D%201%2Fr&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\cos\theta = 1/r' title='\cos\theta = 1/r' class='latex' />
<p>which simplifies the expression further:</p>
<img src='http://s.wordpress.com/latex.php?latex=d%5Comega_%5CTheta%20%3D%20%28%5Ccos%5Ctheta%29%5E3%20da&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='d\omega_\Theta = (\cos\theta)^3 da' title='d\omega_\Theta = (\cos\theta)^3 da' class='latex' />
<p>Using this result and factoring the area of the texels out of the sum we obtain the following expression for the gradient:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cnabla_t%20E_z%28%5Cmathbf%7Bx%7D%29%20%5Csimeq%204%20%5Csum_%7Bi%3D0%7D%5EN%20L_i%20%5Cnabla_t%20%28%5Ccos%5Ctheta_i%29%5E4&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\nabla_t E_z(\mathbf{x}) \simeq 4 \sum_{i=0}^N L_i \nabla_t (\cos\theta_i)^4' title='\nabla_t E_z(\mathbf{x}) \simeq 4 \sum_{i=0}^N L_i \nabla_t (\cos\theta_i)^4' class='latex' />
<p>The remaining faces have similar expressions, slightly more complex, but still easy to differentiate along the x and y directions. We could continue along this path and we would obtain closed formulas that can be used to estimate the translation gradients. However, this simple approach did not produce satisfactory results. The problem is that these gradients assume that the only thing that changes under translation is the projected solid angle of the texels, but that ignores the parallax effect and the occlusion between neighboring texels. That is, samples that correspond to objects that are close to the origin of the hemicube should move faster than those that that are farther, and as they move they may occlude nearby samples.</p>
<p>As you can see in the following lightmap, the use of these gradients resulted in smoother results in areas that are away from occluders, but produced incorrect results whenever the occluders are nearby.</p>
<div id="attachment_727" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-727" src="http://the-witness.net/news/wp-content/uploads/2011/01/translation_gradient_comparison_a.png" alt="" width="600" height="157" /><p class="wp-caption-text">Left: Reference. Middle: Irradiance caching without gradients. Right: Irradiance caching with flawed gradients</p></div>
<p>The hexagonal shape corresponds to the ceiling of a room that has walls along its sides and a window through which the light enters. The image on the left is a reference lightmap with one hemicube sample per pixel. The image on the middle is the same lightmap computed using irradiance caching taking only 2% of the samples. Note that the number of samples is artificially low to emphasize the artifacts. On the right side the same lightmap is computed using the proposed gradients. If you look closely you can notice that on the interior the lightmap looks smoother, but close to the walls the artifacts remain.</p>
<p>This is exactly the same flaw of the gradients that Krivanek et al proposed in <a href="http://cgg.mff.cuni.cz/~jaroslav/papers/tvcg2005/krivanek05radiance_caching.pdf">Radiance Caching for Efficient Global Illumination Computation</a>, but was later corrected in the followup paper <a href="http://cgg.mff.cuni.cz/~jaroslav/papers/sccg2005/sccg2005-krivanek.pdf">Improved Radiance Gradient Computation</a> by approaching the problem the same way Greg Ward did in the original <a href="http://radsite.lbl.gov/radiance/papers/erw92/paper.pdf">original <em>Irradiance Gradients</em> paper</a>.</p>
<p>I then tried follow the same approach. The basic idea is to consider the cosine term invariant under translation so that only the area term needs to be differentiated, and to express the gradient of the cell area in terms of the marginal area changes between adjacent cells. The most important observation is that the motion of the boundary between cells is always determined by the closest sample, so this approach takes occlusion into account.</p>
<p>Unfortunately we cannot directly use Greg Ward&#8217;s gradients, because they are closely tied to the stratified Montecarlo distribution and we are using a hemicube sampling distribution. However, we can still apply the same methodology to arrive to a formulation of the gradients that we can use in our setting.</p>
<p>In our case, the cells are the hemicube texels projected onto the hemisphere and the cell area is the texel solid angle. To determine the translation gradients of the texel&#8217;s solid angle is equivalent to computing the sum of the marginal gradients corresponding to each of the texel walls.</p>
<p>These marginal gradients are the wall normals projected onto the translation plane, scaled by the length of the wall, and multiplied by the rate of motion of the wall in that direction.</p>
<p>Since the hemicube uses a gnomonic projection, where lines in the plane map to great circles in the sphere, the texel boundaries of the hemicubes map to great arcs in the hemisphere. So, the length of these arcs is very easy to compute. Given the direction of the two texel corners <img src='http://s.wordpress.com/latex.php?latex=%5Cmathbf%7Bd%7D_0%2C%20%5Cmathbf%7Bd%7D_1&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\mathbf{d}_0, \mathbf{d}_1' title='\mathbf{d}_0, \mathbf{d}_1' class='latex' />, the length of their hemispherical projection is:</p>
<img src='http://s.wordpress.com/latex.php?latex=arclength%28%5Cmathbf%7Bd%7D_0%2C%20%5Cmathbf%7Bd%7D_1%29%20%3D%20%5Carccos%7B%5Cmathbf%7Bd%7D_0%20%5Ccdot%20%5Cmathbf%7Bd%7D_1%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='arclength(\mathbf{d}_0, \mathbf{d}_1) = \arccos{\mathbf{d}_0 \cdot \mathbf{d}_1}' title='arclength(\mathbf{d}_0, \mathbf{d}_1) = \arccos{\mathbf{d}_0 \cdot \mathbf{d}_1}' class='latex' />
<p>The remaining problem is to compute the rate of motion of the wall, which as Greg Ward noted has to be proportional to the minimum distance of the two samples.</p>
<p>The key observation is that we can classify all the hemicube edges in wo categories: Edges with constant longitude (<img src='http://s.wordpress.com/latex.php?latex=%5Ctheta&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\theta' title='\theta' class='latex' /> is invariant), and edges with constant latitude (<img src='http://s.wordpress.com/latex.php?latex=%5Cphi&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\phi' title='\phi' class='latex' /> is invariant).</p>
<p>In each of these cases we can estimate the rate of change of edges with respect to the normal direction by considering the analogous problem in the <a href="http://mathworld.wolfram.com/SphericalCoordinates.html">canonical hemispherical parametrization</a>:</p>
<p><img src='http://s.wordpress.com/latex.php?latex=r%20%3D%20%5Csqrt%7Bx%5E2%2By%5E2%2Bz%5E2%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='r = \sqrt{x^2+y^2+z^2}' title='r = \sqrt{x^2+y^2+z^2}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%5Cphi%20%3D%20%5Carctan%5Cfrac%7By%7D%7Bx%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\phi = \arctan\frac{y}{x}' title='\phi = \arctan\frac{y}{x}' class='latex' /><br />
<img src='http://s.wordpress.com/latex.php?latex=%5Ctheta%20%3D%20%5Carccos%5Cfrac%7Bz%7D%7Br%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\theta = \arccos\frac{z}{r}' title='\theta = \arccos\frac{z}{r}' class='latex' /></p>
<p>For longitudinal edges we can consider how <img src='http://s.wordpress.com/latex.php?latex=%5Ctheta&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\theta' title='\theta' class='latex' /> changes with respect to motion along the x axis:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B%5Cpartial%5Ctheta%7D%7B%5Cpartial%20x%7D%20%3D%20%5Cfrac%7B-%5Ccos%5Ctheta%7D%7Br%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\frac{\partial\theta}{\partial x} = \frac{-\cos\theta}{r}' title='\frac{\partial\theta}{\partial x} = \frac{-\cos\theta}{r}' class='latex' />
<p>and for latitudinal edges we can consider how <img src='http://s.wordpress.com/latex.php?latex=%5Cphi&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\phi' title='\phi' class='latex' /> changes with respect to motion along the y axis:</p>
<img src='http://s.wordpress.com/latex.php?latex=%5Cfrac%7B%5Cpartial%5Cphi%7D%7B%5Cpartial%20y%7D%20%3D%20%5Cfrac%7B-1%7D%7Br%20%5Csin%5Ctheta%7D&#038;bg=T&#038;fg=ffffff&#038;s=0' alt='\frac{\partial\phi}{\partial y} = \frac{-1}{r \sin\theta}' title='\frac{\partial\phi}{\partial y} = \frac{-1}{r \sin\theta}' class='latex' />
<p>As we noted before, the rate of the motion is dominated by the nearest edge, so r takes the value of the minimum depth of the two samples adjacent to the edge.</p>
<p>A detailed derivation for these formulas can be found in <a href="http://zurich.disneyresearch.com/~wjarosz/publications/">Wojciech Jarosz&#8217;s</a> thesis, I personally found his detailed explanation very didactic, but unfortunately his thesis is not freely available online.</p>
<p>Note that these are just the same formulas used by Greg Ward and others. In practice, the only thing that changes is the layout of the cells and the length of the walls between them.</p>
<p>As can be seen in the following picture, the new gradients produce much better results. Note that the appearance on the interior of the lightmap is practically the same, but closer to the walls the results are now much smoother. Keep in mind that artifacts are still present, because the number of samples is artificially low.</p>
<div id="attachment_1048" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-1048" src="http://the-witness.net/news/wp-content/uploads/2011/06/translation_gradient_comparison.png" alt="" width="600" /><p class="wp-caption-text">Left: No gradients. Middle: Flawed translation gradients. Right: Improved translation gradients.</p></div>
<p>In order to estimate the translation gradients efficiently we precompute the direction and magnitude of the marginal gradients corresponding to each texel edge without taking the distance to the edge into account:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Compute the length of the edge walls multiplied by the rate of motion</span>
<span style="color: #666666;">// with respect to motion in the normal direction</span>
foreach edge in hemicube <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">float</span> wall_length <span style="color: #000080;">=</span> <span style="color: #0000dd;">acos</span><span style="color: #008000;">&#40;</span>dot<span style="color: #008000;">&#40;</span>d0, d1<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    Vector2 projected_wall_normal <span style="color: #000080;">=</span> normalize<span style="color: #008000;">&#40;</span>cross<span style="color: #008000;">&#40;</span>d0, d1<span style="color: #008000;">&#41;</span>.<span style="color: #007788;">xy</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">float</span> motion_rate <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>constant_altitude<span style="color: #008000;">&#40;</span>d0,d1<span style="color: #008000;">&#41;</span> <span style="color: #008080;">?</span>
        <span style="color: #000040;">-</span>cos_theta<span style="color: #008000;">&#40;</span>d0,d1<span style="color: #008000;">&#41;</span> <span style="color: #008080;">:</span>      <span style="color: #666666;">// d(theta)/dx = -cos(theta) / depth</span>
        <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span> <span style="color: #000040;">/</span> sin_theta<span style="color: #008000;">&#40;</span>d0,d1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>   <span style="color: #666666;">// d(phi)/dy = -1 / (sin(theta) * depth)</span>
&nbsp;
    edge.<span style="color: #007788;">translation_gradient</span> <span style="color: #000080;">=</span> projected_wall_normal <span style="color: #000040;">*</span> wall_length <span style="color: #000040;">*</span> motion_rate<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<p>Then, during integration we split the computations in two steps. First, we accumulate the marginal gradients of each of the edges scaled by the minimum edge distance:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">foreach edge in hemicube <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">float</span> depth0 <span style="color: #000080;">=</span> depth<span style="color: #008000;">&#40;</span>edge.<span style="color: #007788;">x0</span>, edge.<span style="color: #007788;">y0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">float</span> depth1 <span style="color: #000080;">=</span> depth<span style="color: #008000;">&#40;</span>edge.<span style="color: #007788;">x1</span>, edge.<span style="color: #007788;">y1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">float</span> min_depth <span style="color: #000080;">=</span> min<span style="color: #008000;">&#40;</span>depth0, depth1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    texel<span style="color: #008000;">&#91;</span>edge.<span style="color: #007788;">x0</span>, edge.<span style="color: #007788;">y0</span><span style="color: #008000;">&#93;</span>.<span style="color: #007788;">translation_gradient</span> <span style="color: #000040;">-</span><span style="color: #000080;">=</span> edge.<span style="color: #007788;">gradient</span> <span style="color: #000040;">/</span> min_depth<span style="color: #008080;">;</span>
    texel<span style="color: #008000;">&#91;</span>edge.<span style="color: #007788;">x1</span>, edge.<span style="color: #007788;">y1</span><span style="color: #008000;">&#93;</span>.<span style="color: #007788;">translation_gradient</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> edge.<span style="color: #007788;">gradient</span> <span style="color: #000040;">/</span> min_depth<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<p>Once we have the per texel gradient, we compute the final irradiance gradient as the sum of the texel gradients weighted by the texel colors:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">foreach texel, color in hemicube <span style="color: #008000;">&#123;</span>
    Vector2 translation_gradient <span style="color: #000080;">=</span> texel.<span style="color: #007788;">translation_gradient</span> <span style="color: #000040;">*</span> texel.<span style="color: #007788;">clamped_cosine</span><span style="color: #008080;">;</span>
    translation_gradient_sum<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> translation_gradient <span style="color: #000040;">*</span> color.<span style="color: #007788;">x</span><span style="color: #008080;">;</span>
    translation_gradient_sum<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> translation_gradient <span style="color: #000040;">*</span> color.<span style="color: #007788;">y</span><span style="color: #008080;">;</span>
    translation_gradient_sum<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> translation_gradient <span style="color: #000040;">*</span> color.<span style="color: #007788;">z</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<h2>Conclusions</h2>
<p>Irradiance Caching provides a very significant speedup to our lightmap baker. On typical meshes we only need to render about 10 to 20% of the samples to approximate the irradiance at very high quality, and for lower quality results or fast previews we can get away with as few as 3% of the samples.</p>
<p>The use of irradiance gradients for interpolation allows reducing the number of samples significantly, or for the same number of samples produces much higher quality results. The following picture compares the results without irradiance gradients and with them, in both cases the number of samples and their location is the same, note how the picture at the bottom has much smoother lightmaps.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/ic_comparison_1.jpg"><img class="aligncenter size-large wp-image-1139" src="http://the-witness.net/news/wp-content/uploads/2011/06/ic_comparison_1-351x384.jpg" alt="" width="351" height="384" /></a></p>
<p>I think that without irradiance caching the hemicube rendering approach to global illumination would have not been practical. That said, implementing irradiance caching robustly is tricky and a lot of tuning and tweaking is required in order to obtain good results.</p>
<p><em>Note: This article is also published on <a href="http://altdevblogaday.com/2011/07/14/irradiance-caching-part-1/">#AltDevBlogADay</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/07/irradiance-caching-part-1/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Tree Update</title>
		<link>http://the-witness.net/news/2011/07/tree-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tree-update</link>
		<comments>http://the-witness.net/news/2011/07/tree-update/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 01:20:38 +0000</pubDate>
		<dc:creator>sgalvin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1159</guid>
		<description><![CDATA[I&#8217;ve been trying to refine the trees to look better, and I&#8217;m fairly happy with the results so far. All too often, game trees are using many tricks to make em look good. Because of that, the geometry often looks like a mess (unless it&#8217;s really high poly). One thing I tried to do is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to refine the trees to look better, and I&#8217;m fairly happy with the results so far. All too often, game trees are using many tricks to make em look good. Because of that, the geometry often looks like a mess (unless it&#8217;s really high poly). One thing I tried to do is make the basic geometry look fairly good, so that the lightmap would make the tree look nice without just revealing ugly basic geometry.</p>
<p>Here&#8217;s some screenshots I just took. Here is a group of trees without a lightmap. As you can see, the underside looks pretty flat and boring, and it&#8217;s hard to see which limbs are in front of others.</p>
<p><a rel="attachment wp-att-1164" href="http://the-witness.net/news/2011/07/tree-update/undertree1-2/"><img class="aligncenter size-large wp-image-1164" src="http://the-witness.net/news/wp-content/uploads/2011/07/undertree11-512x287.jpg" alt="" width="512" height="287" /></a></p>
<p>Here&#8217;s the lightmap just by itself. While you can see a few lighting artifacts (like where the cross trees cross), overall the trees look pretty good even without diffuse textures.</p>
<p><a rel="attachment wp-att-1163" href="http://the-witness.net/news/2011/07/tree-update/undertree3/"><img class="aligncenter size-large wp-image-1163" src="http://the-witness.net/news/wp-content/uploads/2011/07/undertree3-512x287.jpg" alt="" width="512" height="287" /></a></p>
<p>And here&#8217;s the final. As you can see, the underside has a lot more definition to it.</p>
<p><a rel="attachment wp-att-1165" href="http://the-witness.net/news/2011/07/tree-update/undertree2/"><img class="aligncenter size-large wp-image-1165" src="http://the-witness.net/news/wp-content/uploads/2011/07/undertree2-512x287.jpg" alt="" width="512" height="287" /></a></p>
<p>Once I get some LOD&#8217;s I like, I&#8217;ll write up another update.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/07/tree-update/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>A few new graphical effects.</title>
		<link>http://the-witness.net/news/2011/06/a-few-new-graphical-effects/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-few-new-graphical-effects</link>
		<comments>http://the-witness.net/news/2011/06/a-few-new-graphical-effects/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 17:10:40 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Engine Tech]]></category>
		<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1100</guid>
		<description><![CDATA[Lately we started thinking about making the game look better, finally. Ignacio has been working on some graphical effects to this end (though he&#8217;s been putting forth a lot of effort on performance as well). Here are a few things he&#8217;s been working on: Sun beams. These are accomplished with a radial blur centered on [...]]]></description>
			<content:encoded><![CDATA[<p>Lately we started thinking about making the game look better, finally.  Ignacio has been working on some graphical effects to this end (though he&#8217;s been putting forth a lot of effort on performance as well).  Here are a few things he&#8217;s been working on:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_25_n02.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_25_n02-300x168.png" alt="" title="shot_2011.06.28__time_09_25_n02" width="300" height="168" class="aligncenter size-medium wp-image-1102" /></a></p>
<p>Sun beams.  These are accomplished with a radial blur centered on the sun, during postprocessing.  The nice thing about this effect is how dynamic it is &#8212; as you walk beneath the trees, the shape and intensity of the beams are changing all the time.</p>
<p>Due to the way the effect works, sometimes beams are drawn that are a little bit unphysical.  You probably have to be looking closely to see that, but I am a little bit uncomfortable with it given that the game is all about the opposite of that.  We&#8217;ll see how this evolves.  We&#8217;ve been talking about augmenting this with other effects.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_28_n03.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_28_n03-300x168.png" alt="" title="shot_2011.06.28__time_09_28_n03" width="300" height="168" class="aligncenter size-medium wp-image-1103" /></a></p>
<p>A revised water reflection effect.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_28_n05.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_28_n05-300x168.png" alt="" title="shot_2011.06.28__time_09_28_n05" width="300" height="168" class="aligncenter size-medium wp-image-1104" /></a></p>
<p>Softening of the shoreline, so that it doesn&#8217;t look like one big alpha-blended water polygon intersecting the ground.</p>
<p>Here&#8217;s what the island looks like now:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_24_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/shot_2011.06.28__time_09_24_n01-300x168.png" alt="" title="shot_2011.06.28__time_09_24_n01" width="300" height="168" class="aligncenter size-medium wp-image-1101" /></a></p>
<p>It&#8217;s fun to look at this compared to another shot of the island, say, from about a year ago:</p>
<p><a class="shutterset_" href='http://the-witness.net/news/wp-content/gallery/area_summaries/shot_2010-07-11__time_18_02_n05.jpg' title=''><img src='http://the-witness.net/news/wp-content/gallery/area_summaries/thumbs/thumbs_shot_2010-07-11__time_18_02_n05.jpg' alt='Island Snapshot' class='ngg-singlepic ngg-center' /></a></p>
<p>The current puzzle count is 328.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/06/a-few-new-graphical-effects/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>How to program independent games</title>
		<link>http://the-witness.net/news/2011/06/how-to-program-independent-games/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-program-independent-games</link>
		<comments>http://the-witness.net/news/2011/06/how-to-program-independent-games/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 06:16:32 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ill-Advised Rants]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=1004</guid>
		<description><![CDATA[On April 1, 2011, I was invited by UC Berkeley&#8217;s Computer Science Undergraduate Association to come give a speech. This was pretty interesting because that&#8217;s where I went to school, and I was once a member of the CSUA. I approached it this way: if I were going back to speak to my undergraduate self, [...]]]></description>
			<content:encoded><![CDATA[<p>On April 1, 2011, I was invited by UC Berkeley&#8217;s Computer Science Undergraduate Association to come give a speech.  This was pretty interesting because that&#8217;s where I went to school, and I was once a member of the CSUA.  I approached it this way: if I were going back to speak to my undergraduate self, what would I say to help him be most effective at making video games, programming-wise?</p>
<p>The talk&#8217;s about 38 minutes long, with about 40 minutes of Q&#038;A afterward.  Here&#8217;s a slideshow:</p>
<p><center><br />
<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://c.gigcount.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEzMDg4MDkxNjEzMDYmcHQ9MTMwODgwOTE4NjA1OCZwPTc2MTAxJmQ9Jmc9MiZvPTMwMTgzYmZiYzYzMzQ1ZDZiNGUx/Y2ZiZmRhNWZlMmNiJm9mPTA=.gif" />
<div>
<div style="display:block; overflow:hidden; width:400px; padding-top:4px; padding-bottom:2px; font-size:14px; font-family:Verdana, Arial, sans-serif; overflow:hidden"><b><a href="http://www.myplick.com/view/7CRyJCWLM71" target="_blank">CSUA talk</a></b></div>
<p><object width="400" height="343"><param name="movie" value="http://embed.myplick.com/player-thin.swf" /><param name="FlashVars" value="plickName=7CRyJCWLM71"/><embed src="http://embed.myplick.com/player-thin.swf" type="application/x-shockwave-flash" wmode="transparent" width="400" height="343" FlashVars="plickName=7CRyJCWLM71"></embed></object><br />
</center></p>
<p>If the above embedded player doesn&#8217;t work for you, or you prefer to download the files directly, here they are:</p>
<p><a href="http://number-none.com/blow/slides/CSUA%20talk.mp3">audio track</a><br />
<a href="http://number-none.com/blow/slides/CSUA%20talk.ppt">slides (ppt format)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/06/how-to-program-independent-games/feed/</wfw:commentRss>
		<slash:comments>92</slash:comments>
<enclosure url="http://number-none.com/blow/slides/CSUA%20talk.mp3" length="72783027" type="audio/mpeg" />
		</item>
		<item>
		<title>Witness Trees</title>
		<link>http://the-witness.net/news/2011/06/witness-trees/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=witness-trees</link>
		<comments>http://the-witness.net/news/2011/06/witness-trees/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 23:01:19 +0000</pubDate>
		<dc:creator>sgalvin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[Trees]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=951</guid>
		<description><![CDATA[Hi, I&#8217;m Shannon and this in my first blog post about The Witness. I&#8217;m currently the only 3D artist working on the game and this post is about game trees&#8230; both the ones I&#8217;m making and game trees  in general. I&#8217;ve worked on trees for games over the years, and I&#8217;ve come to a conclusion: [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, I&#8217;m Shannon and this in my first blog post about The Witness. I&#8217;m currently the only 3D artist working on the game and this post is about game trees&#8230; both the ones I&#8217;m making and game trees  in general.</p>
<p>I&#8217;ve worked on trees for games over the years, and I&#8217;ve come to a conclusion: There&#8217;s no good way to make them currently. Trees reject the idea of low poly versions of themselves by their very nature, and what you&#8217;re left with is many unsatisfactory ways of making them. It&#8217;s up to the artist to pick which one of these techniques to use and to do their best to make it work. That choice depends on a lot of things. Does it have to be real-time, or can it be pre-rendered? Where will the player be when he sees the tree? Up close, far away, underneath, from above, or (in the worst case) all of these? Will there be a few trees or a forest of them? Then there&#8217;s the engine constraints.  Overdraw, poly counts, texture space, LOD systems, lighting and light maps; all these affect how the trees need to be created. And none of that is even scratching the surface on the style you want the trees to have.</p>
<p>Still, I like a challenge as much as the next person.</p>
<p><a rel="attachment wp-att-952" href="http://the-witness.net/news/?attachment_id=952"><img class="size-medium wp-image-952 aligncenter" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-01-300x182.jpg" alt="" width="300" height="182" /></a></p>
<p>Here&#8217;s an early visual mockup of the game that contains some trees. I didn&#8217;t actually make this, but it did give me some direction is where to go. As you can see, the trees are very colorful and full of volume. I wasn&#8217;t sure how close I could get to this, but I was going to give it a try. The problem with most low-poly game trees is that they are made with large sheets of polygons with branch and bough textures on them&#8230;and while this is certainly a way of making game trees, they usually can&#8217;t be considered volumetric.</p>
<p>The current trees I have right now started from a lucky accident. Early on the engine couldn&#8217;t handle alpha maps, so I want to make a bough structure that would look vaguely leafy without being too many polys and without using opacity maps. That&#8217;s how I came up with this.</p>
<p><a rel="attachment wp-att-953" href="http://the-witness.net/news/?attachment_id=953"><br />
</a><a rel="attachment wp-att-954" href="http://the-witness.net/news/?attachment_id=954"><img class="aligncenter size-large wp-image-954" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-021-512x213.jpg" alt="" width="512" height="213" /></a></p>
<p>It&#8217;s basically a ton of triangles sitting in a bowl. The bowl is there to simplify the bottom and hide the triangle nature of the triangles. It worked fine for the time I needed it. Recently I started adding a bunch of trees to the world and I wanted something fairly lightweight for even the large trees (the one I had done just before that was 40,000 polys, which was way too big). So I went to the old non-opacity tree, added some opacity maps and tried it out. And, surprisingly, it worked really well. It was giving me a volume I didn&#8217;t expect, and it looked really good at a distance.</p>
<p><a rel="attachment wp-att-955" href="http://the-witness.net/news/?attachment_id=955"><img class="aligncenter size-large wp-image-955" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-03-512x327.jpg" alt="" width="512" height="327" /></a></p>
<p>Not only that, I took a look at them with only the lightmaps on and the structure looked really nice&#8230;especially the branches underneath.</p>
<p><a rel="attachment wp-att-956" href="http://the-witness.net/news/?attachment_id=956"><img class="aligncenter size-large wp-image-956" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-04-512x318.jpg" alt="" width="512" height="318" /></a></p>
<p>They were still too heavy though, being 12 thousand polys. Worse, they looked really bad up close and you could see that, what read as a nice, thick foliage from a distance, was really a mess of triangles.</p>
<p><a rel="attachment wp-att-957" href="http://the-witness.net/news/?attachment_id=957"><img class="aligncenter size-large wp-image-957" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-05-415x384.jpg" alt="" width="415" height="384" /></a></p>
<p>So the past few days I&#8217;ve been trying to make the trees look better from a close distance and be lower poly without losing what I liked about the previous ones. After a bit of struggle, I got something that seems to do the trick. Ignacio helped a lot, making a shader that made polys disappear when they became too edge on to the camera, which eliminated many ugly artifacts. The foliage is half the polys of the other trees, plus it looks a lot better close up. Here&#8217;s a close shot of it, plus a comparison shot with an older tree.</p>
<p><a rel="attachment wp-att-960" href="http://the-witness.net/news/?attachment_id=960"><img class="aligncenter size-large wp-image-960" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-061-465x384.jpg" alt="" width="465" height="384" /></a></p>
<p><a rel="attachment wp-att-962" href="http://the-witness.net/news/?attachment_id=962"><img class="aligncenter size-large wp-image-962" src="http://the-witness.net/news/wp-content/uploads/2011/06/trees-072-512x316.jpg" alt="" width="512" height="316" /></a></p>
<p>I still have a bunch of other ideas I want to add to these to make them look better, but I think we&#8217;re on the right track to getting trees that really do have a nice amount of volume and harken back to the early mockups.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/06/witness-trees/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Thinking about color</title>
		<link>http://the-witness.net/news/2011/06/thinking-about-color/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=thinking-about-color</link>
		<comments>http://the-witness.net/news/2011/06/thinking-about-color/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 23:45:22 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=889</guid>
		<description><![CDATA[We&#8217;ve known for a long time that we wanted some kind of color grading to happen in the postprocessing for The Witness; recently we started thinking about what that should be. Shannon wanted to try having colored shadows, as painters often do. We considered different ways of doing this; the &#8220;right way&#8221; to do it [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve known for a long time that we wanted some kind of color grading to happen in the postprocessing for The Witness; recently we started thinking about what that should be.  Shannon wanted to try having colored shadows, as painters often do.  We considered different ways of doing this; the &#8220;right way&#8221; to do it would involve keeping more data in offscreen buffers than we currently do, which could be expensive, but is definitely at least a hassle if you&#8217;re just playing around with ideas.  So instead, we decided to play around with the ambient light color: in shadow, the color of the ambient light is going to be a large influence on the perceived color of the surface, whereas outside of shadow, the color of the sun or light source will dominate, so it can be functionally pretty close to having colored shadows.</p>
<p>But we also figured, hey, why not play around with the color of sunlight as well?  The idea is that as you walk around in the game, the color of the sun and ambient light will interpolate as you move.  We haven&#8217;t hooked it up that way yet; what you see below is just done by tweaking global variables in the game.  Well be doing more experiments in this direction&#8230;</p>
<p><P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-brownside.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-brownside-300x84.jpg" alt="" title="newColor-brownside" width="300" height="84" class="aligncenter size-medium wp-image-911" /></a></p>
<p><P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-gold-side.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-gold-side-300x84.jpg" alt="" title="newColor-gold-side" width="300" height="84" class="aligncenter size-medium wp-image-912" /></a></p>
<p><P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-green-side.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/06/newColor-green-side-300x84.jpg" alt="" title="newColor-green-side" width="300" height="84" class="aligncenter size-medium wp-image-913" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/06/thinking-about-color/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Themed areas</title>
		<link>http://the-witness.net/news/2011/05/themed-areas/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=themed-areas</link>
		<comments>http://the-witness.net/news/2011/05/themed-areas/#comments</comments>
		<pubDate>Sat, 28 May 2011 01:47:53 +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=875</guid>
		<description><![CDATA[As mentioned in the previous couple of updates, we are starting to take steps toward establishing the visual style of the game. This past week while I was on vacation, Shannon did a bunch of world editing, with the primary goal being to draft out a few areas of the world that have different color [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in the previous couple of updates, we are starting to take steps toward establishing the visual style of the game.  This past week while I was on vacation, Shannon did a bunch of world editing, with the primary goal being to draft out a few areas of the world that have different color schemes, as concepted in <a href="http://the-witness.net/news/?p=852">this post</a>.  Here&#8217;s how the island looks with all the new trees, rocks, etc added:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_34_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_34_n01-300x168.png" alt="" title="shot_2011.05.27__time_18_34_n01" width="300" height="168" class="aligncenter size-medium wp-image-877" /></a></p>
<p>Much denser and more visually interesting; it&#8217;s starting to look like maybe a good game!</p>
<p>Here are some close-ups of different areas now.</p>
<p>Autumnal:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_35_n03.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_35_n03-300x168.png" alt="" title="shot_2011.05.27__time_18_35_n03" width="300" height="168" class="aligncenter size-medium wp-image-879" /></a></p>
<p>Desert:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_35_n04.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_35_n04-300x168.png" alt="" title="shot_2011.05.27__time_18_35_n04" width="300" height="168" class="aligncenter size-medium wp-image-880" /></a></p>
<p>Foresty (there is a lightmapping problem on some of these trees so they are brighter than they should be!):</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_34_n02.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.27__time_18_34_n02-300x168.png" alt="" title="shot_2011.05.27__time_18_34_n02" width="300" height="168" class="aligncenter size-medium wp-image-878" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/05/themed-areas/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>More island color experiments; shadow update</title>
		<link>http://the-witness.net/news/2011/05/more-island-color-experiments-shadow-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=more-island-color-experiments-shadow-update</link>
		<comments>http://the-witness.net/news/2011/05/more-island-color-experiments-shadow-update/#comments</comments>
		<pubDate>Wed, 18 May 2011 23:20: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=859</guid>
		<description><![CDATA[Until now, we had been using Uncharted-2-style blend mapping to color our terrain. This is a way of using a low-resolution texture map to control the blending of high-resolution textures; this gives you the ability to maintain fine pixel-by-pixel detail while also blending between multiple textures in order to create larger-scale patterns. (This method is [...]]]></description>
			<content:encoded><![CDATA[<p>Until now, we had been using Uncharted-2-style blend mapping to color our terrain.  This is a way of using a low-resolution texture map to control the blending of high-resolution textures; this gives you the ability to maintain fine pixel-by-pixel detail while also blending between multiple textures in order to create larger-scale patterns.  (This method is in effect in earlier screenshots like <a href="http://the-witness.net/news/?p=835">this one</a>, though keep in mind that we were not using it very seriously in a whole-island kind of way yet.  For some idea of what the blend mapping looks like closer-in, see <a href="http://the-witness.net/news/?p=807">this</a> or <a href="http://the-witness.net/news/?p=784">this</a>.)</p>
<p>But now we are thinking about how to create colorful scenes, like in <a href="http://the-witness.net/news/?p=852">the previous post</a>, and this style of blend-mapping did not seem like a very good idea.  In order to create gradients across the scene, we would need to have a lot of blend layers; this would be slow and use a lot of texture memory (since now we are storing a lot of individual blend maps). Even once we did that, it would be laborious to control, and it&#8217;s unclear that it would look good.</p>
<p>Ignacio mentioned that the Wolfire guys were just dropping one color map across their whole terrain.  That seemed like a good idea to me &#8212; I have done that before, but in contexts where we were trying to really crank up the resolution to levels that were ridiculous at the time, like 8192&#215;8192 texture maps back in 2001.  Rather than doing that, the idea now is to just use what is a reasonable-sized texture on a modern machine, and see what it looks like.  So Shannon painted a 2048&#215;2048 texture of the island (of which we are only really using less than half right now) and here&#8217;s how it looks from up high:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_39_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_39_n01-300x168.png" alt="" title="shot_2011.05.18__time_12_39_n01" width="300" height="168" class="aligncenter size-medium wp-image-860" /></a></p>
<p>Immediately this strikes me as much nicer, and much more in-tune with the art direction we want for the game.  The buildings and other meshes now stick out like sore thumbs, but that is just what happens when you improve only a part of the scene.  We&#8217;ll be working on this.</p>
<p>Here&#8217;s a scene from closer in:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_40_n02.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_40_n02-300x168.png" alt="" title="shot_2011.05.18__time_12_40_n02" width="300" height="168" class="aligncenter size-medium wp-image-861" /></a></p>
<p>As you can see, we have less detail close-up on the ground; things look a bit blurry.  However, the colors are a lot better, and I think if we can adapt this scheme into something that permits sharper details up close, we will be able to make something that has a lot of character and looks special.  In these shots, we are still using the old blend map system to tile high-detail normal maps across the terrain; that helps, but by itself it&#8217;s not enough.  (In recent videos for Overgrowth, <a href="http://blog.wolfire.com/2011/05/Overgrowth-a131-video-changelog">like this one</a>, you can see that they are doing something that provides close-up details, maybe just intensity maps that are being modulated by the color map).  So we&#8217;ll keep working on this and see how it goes.</p>
<p>Meanwhile, Ignacio has been revising the shadow map rendering.  We used to have very speckly shadow maps, as I was using a 4-sample Poisson disc to sample the shadow map.  Ignacio recently switched this to a Gaussian that has more taps, then applied some math tricks to reduce the number of taps.  This results in softer shadows:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_42_n03.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_42_n03-300x168.png" alt="" title="shot_2011.05.18__time_12_42_n03" width="300" height="168" class="aligncenter size-medium wp-image-862" /></a></p>
<p>At some angles, shadow map jaggies still show up pretty clearly:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_42_n04.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/shot_2011.05.18__time_12_42_n04-300x168.png" alt="" title="shot_2011.05.18__time_12_42_n04" width="300" height="168" class="aligncenter size-medium wp-image-863" /></a></p>
<p>This is something we might work around in the final game by changing the scene when this happens!  Or, it&#8217;s possible the shadows will be modified further so that they look smoother in cases like this.  Who can say?</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/05/more-island-color-experiments-shadow-update/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Landscape color studies</title>
		<link>http://the-witness.net/news/2011/05/landscape-color-studies/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=landscape-color-studies</link>
		<comments>http://the-witness.net/news/2011/05/landscape-color-studies/#comments</comments>
		<pubDate>Sat, 14 May 2011 00:25:29 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=852</guid>
		<description><![CDATA[Now that the gameplay is further along, we are starting to think more seriously about how the game is going to look. Shape and color are very important thematically; one idea that&#8217;s been floating around for a while is that different locations on the island would have very different color palettes associated with them, and [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the gameplay is further along, we are starting to think more seriously about how the game is going to look.  Shape and color are very important thematically; one idea that&#8217;s been floating around for a while is that different locations on the island would have very different color palettes associated with them, and that this would help cement the locations&#8217; individual personalities.  (This is not in principle a new idea; games often do this kind of thing, but I think the way we do it will make it special).</p>
<p>Shannon did a few color studies by taking screenshots of the game world as it stands today, then painting over them to build scenes with different palettes.  Here&#8217;s what he came up with:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/05/colors-gold.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/colors-gold-300x188.jpg" alt="" title="colors-gold" width="300" height="188" class="aligncenter size-medium wp-image-854" /></a><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/05/colors-brown.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/colors-brown-300x168.jpg" alt="" title="colors-brown" width="300" height="168" class="aligncenter size-medium wp-image-853" /></a><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/05/colors-green.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/05/colors-green-300x169.jpg" alt="" title="colors-green" width="300" height="169" class="aligncenter size-medium wp-image-855" /></a></p>
<p>I think it looks quite nice.  Don&#8217;t assume much based on the painterly style of these images; they were intentionally done at a low level of detail, so that we could quickly get a feel for the colors.  We don&#8217;t know yet exactly what the rendering style of the game will be in the end (but that is something we will start working on soon!)</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/05/landscape-color-studies/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Whew!</title>
		<link>http://the-witness.net/news/2011/04/whew/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=whew</link>
		<comments>http://the-witness.net/news/2011/04/whew/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 05:55:53 +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=835</guid>
		<description><![CDATA[In a previous post I mentioned that we had done a bunch of playtesting at the GDC. As a result of that playtesting, I ended up heavily restructuring some areas of the game world. On top of that, there were a few areas that had been incomplete at that time, and I felt it was [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://the-witness.net/news/?p=826">previous post</a> I mentioned that we had done a bunch of playtesting at the GDC.  As a result of that playtesting, I ended up heavily restructuring some areas of the game world.  On top of that, there were a few areas that had been incomplete at that time, and I felt it was important to  get those finished.  So after the GDC I entered a period of very hard work to get all this stuff done, and it is now done!  Here is how the island is looking now:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/04/shot_2011.04.24__time_22_27_n01.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/04/shot_2011.04.24__time_22_27_n01-512x288.png" alt="" title="shot_2011.04.24__time_22_27_n01" width="512" height="288" class="aligncenter size-large wp-image-836" /></a></p>
<p>The puzzle count is now 285.</p>
<p>This means I am getting closer to my Gameplay Complete milestone.  The bulk of the game design is now more-or-less there, in the sense that you can go and solve all the puzzles and they are basically the body of puzzles that will be there for the final game (though in the final game they will be refined, and more will be added &#8212; but if we had to ship with only the puzzles that are in there now, we could do that, and it would be a good game).  However, there&#8217;s no endgame or winning condition, so I will be working on this next.  </p>
<p>I think the endgame is going to be a bunch of work &#8212; the original idea was ambitious, and I need to do a bunch of redesign on it since the game as a whole has evolved since the time the endgame was originally conceived.  We&#8217;ll see how it goes.</p>
<p>The visuals are still placeholder.  In a couple of weeks we have some architects coming in to start designing buildings and terrain; at that time our production pipeline will change and we&#8217;ll be moving a little closer to &#8220;the real visuals&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/04/whew/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Braid playthrough with director&#8217;s commentary</title>
		<link>http://the-witness.net/news/2011/04/braid-playthrough-with-directors-commentary/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=braid-playthrough-with-directors-commentary</link>
		<comments>http://the-witness.net/news/2011/04/braid-playthrough-with-directors-commentary/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 04:53:52 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Other Games]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=833</guid>
		<description><![CDATA[At GameCity in Nottingham, UK in September 2010, I played through select portions of Braid and gave commentary. I had been under the impression the session was officially recorded, and I’ve been waiting for an official video to hit the internet, but at this point I am not sure this was done. Fortunately someone in [...]]]></description>
			<content:encoded><![CDATA[<p>At GameCity in Nottingham, UK in September 2010, I played through select portions of Braid and gave commentary. I had been under the impression the session was officially recorded, and I’ve been waiting for an official video to hit the internet, but at this point I am not sure this was done. Fortunately someone in the audience had a handheld camera, and has posted the footage to YouTube. This is by far the most I’ve said about Braid in one place…</p>
<p><a href="http://www.youtube.com/watch?v=gwsi7TEQxKc">See the video here.</a></p>
<p><em>Thanks to blog commenter justin for pointing this out!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/04/braid-playthrough-with-directors-commentary/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>GDC Playtesting; the island shrinks again&#8230;</title>
		<link>http://the-witness.net/news/2011/03/gdc-playtesting-the-island-shrinks-again/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gdc-playtesting-the-island-shrinks-again</link>
		<comments>http://the-witness.net/news/2011/03/gdc-playtesting-the-island-shrinks-again/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 07:53:51 +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=826</guid>
		<description><![CDATA[This month was time for the annual Game Developers Conference in San Francisco [this has been its official name for a while now: the completely ungrammatical "Game Developers Conference". Whatever.] We used this opportunity to have game designer friends come and playtest The Witness. We did somewhere between 40 and 50 hours of playtesting that [...]]]></description>
			<content:encoded><![CDATA[<p>This month was time for the annual Game Developers Conference in San Francisco [this has been its official name for a while now: the completely ungrammatical "Game Developers Conference".  Whatever.]  We used this opportunity to have game designer friends come and playtest The Witness.  We did somewhere between 40 and 50 hours of playtesting that week, and it was all very useful. Thanks to everyone who came by and played!</p>
<p>As a result of these sessions it immediately became clear how to redesign some of the areas to improve pacing.  So I started radically restructuring three of the major areas, as well as rearranging the relative positions of areas on the map.  That process isn&#8217;t done yet, but it is starting to converge (just one more area left to redesign).  I am very happy with the two areas already redesigned; they are obviously far better than the original versions.  It feels very rewarding when you feel good about a game already, and then do something to improve it so much.</p>
<p>Also, I&#8217;ve shrunk the island again.  Here&#8217;s what it looks like now:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/03/island_shot.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/03/island_shot-512x288.jpg" alt="" title="island_shot" width="512" height="288" class="aligncenter size-large wp-image-827" /></a></p>
<p>The current puzzle count is 275.</p>
<p>Also, <a href="http://the-witness.net/news/?p=815">we are hiring</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/03/gdc-playtesting-the-island-shrinks-again/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Jobs!</title>
		<link>http://the-witness.net/news/2011/03/jobs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jobs</link>
		<comments>http://the-witness.net/news/2011/03/jobs/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 05:15:29 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=815</guid>
		<description><![CDATA[We are hiring. We at Thekla, Inc. are a small independent developer making games with tradition-breaking designs.  We are pushing the boundaries of what a video game can be. Our current project is The Witness, a puzzle/exploration game designed by Jonathan Blow, designer/programmer of the critically-acclaimed Braid.  Our office is in Berkeley, California, USA but we [...]]]></description>
			<content:encoded><![CDATA[<p>We are hiring.</p>
<p>We at Thekla, Inc. are a small independent developer making games with tradition-breaking designs.  We are pushing the boundaries of what a video game can be. Our current project is <em>The Witness</em>, a puzzle/exploration game designed by Jonathan Blow, designer/programmer of the critically-acclaimed <em>Braid</em>.  Our office is in Berkeley, California, USA but we will consider remote work for the right candidates.<br />
<BR><P><br />
<strong>Senior Game Programmer (full-time)</strong></p>
<p>Work with other excellent programmers to build technically-sophisticated games for a variety of platforms, including consoles, PCs, and tablets.  Work on systems-level infrastructure as well as gameplay code.  You get a lot of freedom to approach problems the way you want to, and to employ your full range of technical creativity.  Management overhead is minimal.  There are many perks you won&#8217;t find in other jobs.</p>
<p>Our code is mainly in C++.  When it comes to building software, we have a no-nonsense approach. </p>
<p>Job Requirements:</p>
<ul>
<li>Be good at making video games.</li>
</ul>
<p><BR><P><br />
<strong>Senior Game Programmer (part-time, contract)<br />
</strong><br />
Like the job above, but part-time.</p>
<p>To inquire about any of these jobs, please send email to <a href="mailto:jon@number-none.com">jon@number-none.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/03/jobs/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Grassing it up&#8230;</title>
		<link>http://the-witness.net/news/2011/02/grassing-it-up/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=grassing-it-up</link>
		<comments>http://the-witness.net/news/2011/02/grassing-it-up/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 06:05:14 +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=807</guid>
		<description><![CDATA[Since The Witness takes place in the outdoors much of the time, we knew from early on that we were going to want to have grass of some kind. We added grass into the engine quite a long time ago (starting around December 2009?) and it&#8217;s gone through several iterations of what-seemed-to-make-sense-at-the-time. At this point, [...]]]></description>
			<content:encoded><![CDATA[<p>Since The Witness takes place in the outdoors much of the time, we knew from early on that we were going to want to have grass of some kind.  We added grass into the engine quite a long time ago (starting around December 2009?) and it&#8217;s gone through several iterations of what-seemed-to-make-sense-at-the-time.  At this point, it is starting to be kind-of reasonable, so to spruce up the game a little bit for next week&#8217;s conference, I started using grass willy-nilly around the world.  (You may have seen a little bit of grass creep into earlier screenshots, but prior to today it had been confined to very small areas of the island).</p>
<p>Here&#8217;s what it looks like now:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/02/grass.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/02/grass-512x288.jpg" alt="" title="grass" width="512" height="288" class="aligncenter size-large wp-image-808" /></a></p>
<p>It does not look shipping-quality, but then, almost nothing in the game does!  As the first results obtained by just slapping some pre-existing grass meshes down on the terrain without trying too hard, I find it highly encouraging.</p>
<p>Note that grass doesn&#8217;t cast shadows right now.  There are two reasons for that: rendering speed and aliasing of the shadow map.  I suspect we will try to make grass cast shadows before we ship, though, and if we make something good happen there, I think it will really boost the visual quality.</p>
<p>The one piece of code that pushed the grass over the threshold into general usability is that it now has the ability to sample terrain blend maps.  (The terrain uses a blend shader, where a non-visible blend texture map controls the degree of mixing of different terrain materials.  This is becoming a common thing in 3D games; Uncharted 2 and Crysis 2 do it, among others.)  The grass can now peek at the blend map and reduce its density in areas of particular blend values, which is why in this screenshot that path going up the hill is free of grass.  This tremendously reduces the amount of manual tweaking required to make the grass not do obviously-bad things.</p>
<p>However, the grass doesn&#8217;t check for buildings yet, which means if you place a field of grass across the area of a building, the grass will probably stick up through the floor inside the building!  Fixing that is next on my to-do list, but it involves a lot of raycasting, so hopefully it doesn&#8217;t make grass placement too slow.</p>
<p>In the future I plan to try using this same &#8220;grass&#8221; system for other kinds of scattered ground objects (fallen leaves, twigs, small rocks, etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/02/grassing-it-up/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Update!</title>
		<link>http://the-witness.net/news/2011/02/update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=update</link>
		<comments>http://the-witness.net/news/2011/02/update/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 21:38:02 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=801</guid>
		<description><![CDATA[Toward the back you can see some of the stuff that was being worked on in the previous post (but from a different angle!) The current puzzle count is 251. That&#8217;s pretty good, but on top of the increase from last time, another 25 of the old puzzles were rewritten. So a bunch of stuff [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011-512x288.jpg" alt="" title="shot_2011" width="512" height="288" class="aligncenter size-large wp-image-802" /></a></p>
<p>Toward the back you can see some of the stuff that was being worked on in <a href="http://the-witness.net/news/?p=784">the previous post</a> (but from a different angle!)</p>
<p>The current puzzle count is 251.  That&#8217;s pretty good, but on top of the increase from last time, another 25 of the old puzzles were rewritten.  So a bunch of stuff has gotten done!  </p>
<p>Over the next couple of weeks, I will be hammering on the puzzles even more, as we get the game to a new level of completion and playability.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/02/update/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>A glimpse into the terrain design process.</title>
		<link>http://the-witness.net/news/2011/02/a-glimpse-into-the-terrain-design-process/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-glimpse-into-the-terrain-design-process</link>
		<comments>http://the-witness.net/news/2011/02/a-glimpse-into-the-terrain-design-process/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 03:15:52 +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=784</guid>
		<description><![CDATA[This is an experiment in writing up a blog post for a development task while I actually perform the task!  So right now, as I start writing this, I don&#8217;t know how it will end! I was talking to David Hellman about the game the other day, and he was asking when the island was [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is an experiment in writing up a blog post for a development task while I actually perform the task!  So right now, as I start writing this, I don&#8217;t know how it will end!</em></p>
<p><em><br />
</em></p>
<p>I was talking to David Hellman about the game the other day, and he was asking when the island was going to become less like a flat plane where you can just walk to any destination from anywhere else.</p>
<p>It&#8217;s been on my to-do list for a while to add more topology to the island.  That week I had been working on an area full of puzzles, and I wanted the buildings that define this area to have more of a purpose than they currently do; a topological purpose seemed like the right thing.</p>
<p>So I figured I&#8217;d add a canyon, and the building containing these puzzles would also serve as a bridge across the canyon.</p>
<p>The natural way to build the canyon in this engine is to shape it out generally with terrain control points, and then make the walls steep by putting mesh objects in there (so that you can&#8217;t walk up them, and so that the walls of the canyon won&#8217;t look super-distorted the way heightfield terrains usually do when there are steep slopes.)</p>
<p>Here was the first cut at it:</p>
<p><img class="aligncenter size-large wp-image-789" title="shot_2011.02.13__time_16_21_n01 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.13__time_16_21_n01-copy-512x288.jpg" alt="" width="512" height="288" /></p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/02/Untitled-2-copy.jpg"></a></p>
<p><span id="more-784"></span></p>
<p>As you can see, there are a lot of weird ripples and curves happening there.  This is what signal processing people might call &#8220;ringing&#8221;.  What&#8217;s happening is that the Kriging system that we are using for terrain modeling is always trying to reconstruct a smooth function, but what we are trying to build here is a discontinuous function (or else a function so steep that it has a lot of high frequencies in it).</p>
<p>There are a number of ways that one might fix this, but the cheap and hacky one, which would work not only for Kriging but for any other terrain modeling stuff we might stick in in the future, is to add the notion of separating planes that represent discontinuities in the terrain.  When evaluating the height of the terrain at any point, we just ignore any control points that are on the other side of the separating plane.</p>
<p>Adding discontinuities has been on my to-do list since last year when Kriging was added to the engine.  It was pretty obvious that it would be needed eventually, but in the spirit of getting things done and not rat-holing on technology, I chose to put it off for as long as possible.  But it makes sense that if we are starting to add more topology to the island, we are going to want to have more steep places, and so it&#8217;s time to add this.</p>
<p>(We&#8217;ve already had this steepeness problem before, though: if you look at this plateau that is near the camera in our regular island snapshots, you&#8217;ll see that the whole thing is made out of mesh objects, rather than terrain; we did this in order to avoid this very same ringing problem:)</p>
<p><img class="aligncenter size-large wp-image-790" title="shot_2011.02.13__time_16_23_n02 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.13__time_16_23_n02-copy-512x288.jpg" alt="" width="512" height="288" /></p>
<p>It didn&#8217;t take long to add discontinuity entities into the editor; here&#8217;s how they are represented:</p>
<p><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><img class="aligncenter size-large wp-image-787" style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="Untitled-1 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/Untitled-1-copy-512x288.jpg" alt="" width="512" height="288" /></span></p>
<div><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><br />
</span></div>
<p>To start with, I just used a really dumb heuristic to decide when control points should be excluded.  When we use this, here&#8217;s the result:</p>
<p><img class="aligncenter size-large wp-image-786" style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="shot_2011.02.13__time_17_41_n03 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.13__time_17_41_n03-copy-512x288.jpg" alt="" width="512" height="288" /><a href="http://the-witness.net/news/wp-content/uploads/2011/02/Untitled-1-copy.jpg"></a></p>
<p>There is still a bunch of heightfield terrain sticking out.  What&#8217;s going on?  If we look back at our red discontinuity planes, it is clear that there are some terrain sample points inside the canyon that are getting treated as if they were outside:</p>
<p><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><img class="aligncenter size-large wp-image-788" style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="Untitled-2 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/Untitled-2-copy-512x288.jpg" alt="" width="512" height="288" /></span></p>
<div><span style="color: #0000ee;"><br />
</span></div>
<p>What&#8217;s going on is that my simple criterion said &#8220;if you are on the opposite side of a discontinuity plane from a control point, ignore that control point&#8221;.  The problem is that I am treating them as infinite planes, so those points that you see, which are in front of one plane, are actually outside a <em>neighboring </em>plane, if you were to extend that plane infinitely.  This is no surprise; I knew it would be a problem, but I am always about implementing the simple thing first and seeing what happens.  But now I need a heuristic that will fix this problem.</p>
<p>One solution would be to combine the discontinuity objects into sequences of points, and then do some more-heuristicky things that may be easier because we have an ordering between the points.  But I don&#8217;t want to resort to that if I don&#8217;t have to, because that may make the system less general, and may make it harder to edit.  (Then again it may make it easier to edit, because we have editor support for paths!  But if we want to, we can easily go the other way, from a path down to individual slabs, so it&#8217;s better to take the most-primitive thing as input if we are able to.)<br />
</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1882px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline;"><img class="aligncenter size-large wp-image-787" style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="Untitled-1 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/Untitled-1-copy-512x288.jpg" alt="" width="512" height="288" /></span></div>
<p>I added a check that would make discontinuity planes irrelevant if the sample points are closer to the side planes of these very thin slabs than they are to the face planes.  In theory that would at least help, but upon running this, the scene looked almost exactly the same.</p>
<p>Then upon further investigation I found that I was computing totally wrong planes in the Kriging code; I was transforming the coordinates incorrectly, and so the planes were not in fact where the red slabs in the picture would show them to be.  I fixed this:</p>
<div><a href="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.13__time_19_05_n01-copy.jpg"><img class="aligncenter size-large wp-image-794" title="shot_2011.02.13__time_19_05_n01 copy" src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.13__time_19_05_n01-copy-512x288.jpg" alt="" width="512" height="288" /></a></div>
<p>Ahhh, much better.  This seems like it will be good enough for now.  There&#8217;s still the question of how to seamlessly blend the heightfield terrain into the mesh objects, but that can wait until closer to ship.  For now, it doesn&#8217;t need to be pretty; it just needs to let us build things of roughly the right shape.</p>
<p><P></p>
<p>The heuristic I use for discarding points is still pretty simplistic and may cause problems.  My hope is that most of those problems can be worked around just by changing the planes a bit.  If that turns out not to be true, a little more work will need to be done here!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/02/a-glimpse-into-the-terrain-design-process/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>How many puzzles are in The Witness?</title>
		<link>http://the-witness.net/news/2011/02/how-many-puzzles-are-in-the-witness/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-many-puzzles-are-in-the-witness</link>
		<comments>http://the-witness.net/news/2011/02/how-many-puzzles-are-in-the-witness/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 05:13:35 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=775</guid>
		<description><![CDATA[Today I was deleting an old area of the island, which had about 25 puzzles in it that I wasn&#8217;t happy with. I took to wondering how many puzzles would be left on the island after I deleted those, so I added a console command to count puzzles: So, there are 222 puzzles left in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was deleting an old area of the island, which had about 25 puzzles in it that I wasn&#8217;t happy with.  I took to wondering how many puzzles would be left on the island after I deleted those, so I added a console command to count puzzles:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/02/puzzles.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/02/puzzles.jpg" alt="" title="puzzles" width="497" height="352" class="aligncenter size-full wp-image-776" /></a></p>
<p>So, there are 222 puzzles left in the game (I just deleted about 10% of them).  </p>
<p>Many more puzzles are going to be added; I would guess that by the time the game is done, there will be over 400.  We&#8217;ll see; I think this will be a fun statistic to watch, along with those screenshots of the island.</p>
<p>In comparison, <em>Braid</em> has about 76 puzzles in it.  So that tells you something about the relative sizes of the games.  That said, the puzzles in <em>The Witness</em> are often intended to be bite-sized and quick, so it&#8217;s not really a direct comparison.  (On the other hand, some of the puzzles are most definitely not bite-sized and quick!) </p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/02/how-many-puzzles-are-in-the-witness/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Island Update</title>
		<link>http://the-witness.net/news/2011/02/island-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-update</link>
		<comments>http://the-witness.net/news/2011/02/island-update/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 01:01:08 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=770</guid>
		<description><![CDATA[The past week has been a very productive time in terms of world-building. The island has been shrunk further, with several of the locations that used to be further to the right moved inward. The white-walled location from last time used to be a standalone structure, but is now built into the side of that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/02/shot_2011.02-512x288.jpg" alt="" title="shot_2011.02" width="512" height="288" class="aligncenter size-large wp-image-771" /></a></p>
<p>The past week has been a very productive time in terms of world-building.  The island has been shrunk further, with several of the locations that used to be further to the right moved inward.  <a href="http://the-witness.net/news/?p=763">The white-walled location from last time</a> used to be a standalone structure, but is now built into the side of that plateau nearest the camera, and has a new structure next to it.  One of the prominent garden areas has been redesigned; you may notice it a bit to the left of the center of the map.  On top of all this, a new underground area has been added, and I really like some of the puzzles in there.</p>
<p>When the new area gets finished gameplay-wise I will post some shots of that.</p>
<p>Up next: adding more puzzles!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/02/island-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Island Today</title>
		<link>http://the-witness.net/news/2011/01/the-island-today-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-island-today-2</link>
		<comments>http://the-witness.net/news/2011/01/the-island-today-2/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 07:01:25 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=763</guid>
		<description><![CDATA[Here&#8217;s your Island Snapshot for the end of January. Recently, we&#8217;ve been mostly working on things you can&#8217;t see, but you may notice some subtler differences in terms of buildings / structures. The most obvious difference from the previous shot is the thicker atmosphere. Ignacio changed the fog model; the fact that we have a [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s your Island Snapshot for the end of January.  Recently, we&#8217;ve been mostly working on things you can&#8217;t see, but you may notice some subtler differences in terms of buildings / structures.</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/01/island_shot.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/island_shot-512x288.jpg" alt="" title="island_shot" width="512" height="288" class="aligncenter size-large wp-image-764" /></a></p>
<p>The most obvious difference from the previous shot is the thicker atmosphere.  Ignacio changed the fog model; the fact that we have a bit more fog, combined with the art style we&#8217;ve converged on, should help us do high-quality LOD handling for distant objects.</p>
<p>Your bonus picture for today is part of an indoor complex that I am very happy with.  This room is all white with a bit of colored glass.  Note the lovely lightmapping, even on such slapped-together geometry:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/01/room_shot.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/room_shot-512x288.jpg" alt="" title="room_shot" width="512" height="288" class="aligncenter size-large wp-image-765" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/01/the-island-today-2/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Adventures in Fisheye Lenses</title>
		<link>http://the-witness.net/news/2011/01/adventures-in-fisheye-lenses/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adventures-in-fisheye-lenses</link>
		<comments>http://the-witness.net/news/2011/01/adventures-in-fisheye-lenses/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 01:32:12 +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=729</guid>
		<description><![CDATA[During the past couple of weeks, we have been doing some experiments for The Witness that involve pre-rendering a scene with a fisheye lens and then using that render during gameplay. If I were to say exactly what this is for, it would be a massive spoiler, so I&#8217;ll just say it&#8217;s for a kind [...]]]></description>
			<content:encoded><![CDATA[<p>During the past couple of weeks, we have been doing some experiments for <em>The Witness</em> that involve pre-rendering a scene with a fisheye lens and then using that render during gameplay.  If I were to say exactly what this is for, it would be a <strong>massive spoiler</strong>, so I&#8217;ll just say it&#8217;s for a kind of environment-mapped rendering.</p>
<p>The general requirement was that we need to be able to capture a pre-rendered scene with a really wide viewing angle.  At first I was confused about the technical aspects of the problem (hopefully forgivable, since I spend most of my time thinking about gameplay these days, so my tech is a little rusty), so I thought that we might need to have a linear projection in order to solve the specific problem under consideration.  So Shannon made a mock-up scene in 3D Studio MAX and we started making prerenders with increasingly wide camera angles, in order to test our special environment mapping.  Here are three shots of the same scene with fields-of-view of 90 degrees, 120 degrees, and 150 degrees:<br />
<P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h16m58s53.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h16m58s53-512x384.png" alt="" title="linear_90degrees" width="307" height="269" class="aligncenter size-large wp-image-730" /></a><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h17m22s200.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h17m22s200-512x204.png" alt="" title="linear_120degrees" width="512" height="204" class="aligncenter size-large wp-image-731" /></a><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h19m08s237.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h19m08s237-512x204.png" alt="" title="linear_150degrees" width="512" height="204" class="aligncenter size-large wp-image-732" /></a><br />
<P><br />
<em>(Click on the images to see actual sizes.)</em></p>
<p><span id="more-729"></span></p>
<p>It&#8217;s clear that as the field of view becomes wider, we can see more of the scene at once, laterally.  This is good for our application, because we want to see as much as possible!  But at the same time, when the angle is wide, objects at the center of the scene appear further away, occupying fewer pixels in the rendered image.  This is bad because it means we only have low-resolution imagery for the most important things in the scene!  <em>(These screenshots are also badly artifacted because for some reason the avi encoder we were using interlaces the output by default, and we couldn&#8217;t find a way to not interlace, without using a different codec!  Hint to anyone making a video codec, anywhere in the past or future of this universe or any other: <strong>NOBODY LIKES INTERLACING.  IT IS UGLY AND CAUSES A LOT OF PROBLEMS.  DON&#8217;T DO IT.  Please do your part to make the world a better place.</strong>)</em></p>
<p>It&#8217;s around this time that I realized we didn&#8217;t have to use a linear projection, which was good &#8212; if we can warp the image however we need to, then we can have the important parts of the scene landing really big in the middle of the texture, using lots of pixels, and squeeze the rest of the scene nonlinearly around the edges of the bitmap, using fewer pixels.</p>
<p>A 180-degree fisheye lens seemed like the right tool to do this.  For other reasons that I won&#8217;t go into, another nice property of the fisheye lens (as opposed to some arbitrary distortion) is that it is physically plausible &#8212; you can mount a fisheye lens onto a physical camera and generate a similar image.</p>
<p>We found some plugins for Mental Ray (a renderer that you can use from Max or Maya) that seemed to do the trick.  Here&#8217;s the output of one of the plugins we found (this is from <a href="http://pixero.com/downloads_mr.html">Jan Sandstr&ouml;m&#8217;s JS_fisheye.c</a>, which appears to be a modification of a simple fisheye lens shader in the Mental Ray reference manual):</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h40m09s91.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h40m09s91-384x384.png" alt="" title="JS_fisheye" width="384" height="384" class="aligncenter size-large wp-image-742" /></a></p>
<p>Unfortunately the field of view in this image we saved is less than 180 degrees, which makes it hard to directly compare with the later images, but just look at the basic character of it for now.</p>
<p>At first I assumed that this shader was implementing actual fisheye lens math, though there were no real comments to go on.  Here&#8217;s the math used in the stripped-down Mental Ray Reference Manual:</p>
<p><code>
<pre>
    mi_vector_to_camera(state, &#038;camdir, &#038;state->dir);
    t = state->camera->focal / -camdir.z /
           (state->camera->aperture/2);
    x = t * camdir.x;
    y = t * camdir.y * state->camera->aspect;
    r = x * x + y * y;
    if (r < 1) {
        dir.x = camdir.x * r;
        dir.y = camdir.y * r;
        dir.z = -sqrt(1 - dir.x*dir.x - dir.y*dir.y);
        mi_vector_from_camera(state, &#038;dir, &#038;dir);
        return(mi_trace_eye(result, state, &#038;state->org, &#038;dir));
    }
</pre>
<p></code></p>
<p>(JS_fisheye.c has more parameters but is basically the same thing.)</p>
<p>Essentially, this code takes an input texture coordinate and converts it into a view vector in 3D space.  In order to use the rendered image from within a shader in the game, I need to be able to invert this function: turn it from a view vector into a 2D texture coordinate.  But when I tried to do this, I had all kinds of problems: the math was messy and ugly.  I got the inkling that this shader may not be acting as a physical lens really would, but rather, was a 2D image-warping effect that gives the same general impression as a fisheye lens.</p>
<p>(The reason for thinking this is that light behaves bidirectionally; there&#8217;s no difference between light moving forward and light moving backward.  So if something is simple when light is going in one direction, it ought to be simple in the other direction too.  If the equation starts looking a lot more complicated, that is sort-of a violation of the way that the physical universe works, mathematically, and so one starts thinking that something is wrong.  That was the intuition I had, anyway.)</p>
<p>Over on <a href="http://wiki.panotools.org/Fisheye_Projection">this page</a> I found a nice reference for the way that a real fisheye lens bends light.  Indeed the equation is very simple (though as it is written on that page, it&#8217;s not quite in the proper form for us to use).  Based on that, I wrote a new Mental Ray shader that looks like this:</p>
<p><code>
<pre>
    mi_vector_to_camera(state, &#038;camdir, &#038;state->dir);
    miScalar x = state->raster_x / state->camera->x_resolution * 2 - 1;
    miScalar y = state->raster_y / state->camera->y_resolution * 2 - 1;

    miScalar r2 = x * x + y * y;

    if (r2 < 1) {
        miScalar c = 1 - r2;
        miScalar s = sqrtf(2 - r2);

        dir.x = x * s;
        dir.y = y * s;
        dir.z = -c;  

        mi_vector_from_camera(state, &#038;dir, &#038;dir);
        return mi_trace_eye(result, state, &#038;state->org, &#038;dir);
    }
</pre>
<p></code></p>
<p>Superficially it doesn&#8217;t look too different from the previous example, but in fact this version refracts light in a physical way and is invertible.  Here&#8217;s what a render looks like using this lens:<br />
<P><br />
<a href="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h40m39s8.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/vlcsnap-2011-01-22-16h40m39s8-384x384.png" alt="" title="vlcsnap-2011-01-22-16h40m39s8" width="384" height="384" class="aligncenter size-large wp-image-743" /></a></p>
<p>As I mentioned, it&#8217;s hard to compare with the earlier shot because the field-of-view is different (sorry about that), but I think it&#8217;s evident that the nature of the distortion is fairly different between the two shots.  In our version, it feels milder.</p>
<p>Here&#8217;s the runtime pixel shader code that inverts it:</p>
<p><code>
<pre>
    // (xprime, yprime, zprime) is the view vector in the same space where the environment map was rendered.

    float c = abs(zprime);

    video_uv.xy = float2(xprime, yprime);
    float scale = 1 / sqrt(1 + c);
    video_uv.xy *= scale;

    // Now we have video_uv in [-1, 1]; for [0, 1], scale appropriately.
</pre>
<p></code></p>
<p>It&#8217;s very simple, and the only real math required is a multiplication by a reciprocal square root (very fast for shaders!)  So that was pleasant.</p>
<p>Once we had these both hooked up and working, the scene rendered perfectly, and we knew that the effect we wanted to create was achievable.  By way of improving it, Ignacio suggested using a cylinder map instead of a fisheye lens, because that is better for this particular shot: we need to render a wide room, and see a lot laterally, but the vertical span is roughly constant and much shorter than the horizontal span.  (The fisheye lens is more general, and we can use it for any scene, but to optimize texture resolution for specific cases, we might go to other things like the cylinder map.  You can think of the cylinder map as being fisheyed along only one axis.)</p>
<p>Here&#8217;s the cylinder map version of the scene:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2011/01/cylinder_map.png"><img src="http://the-witness.net/news/wp-content/uploads/2011/01/cylinder_map-512x325.png" alt="" title="cylinder_map" width="512" height="325" class="aligncenter size-large wp-image-741" /></a></p>
<p>This is what we are going with for now.  Problem solved, job seemingly well-done.</p>
<p>Ignacio put the cylinder mapping code into the same shader as the fisheye lens, and also added a latitude-longitude distortion.  </p>
<p>Our work was sped up drastically by the fact that we were able to find JS_fisheye.c free on the internet, as well as information for the way a fisheye lens works.  So here&#8217;s our attempt to give back a little: our final Mental Ray shader and the .mi file that defines the interface for it:<br />
<P><br />
<a href='http://the-witness.net/news/wp-content/uploads/2011/01/witness_fisheye.c'>witness_fisheye.c</a><br />
<a href='http://the-witness.net/news/wp-content/uploads/2011/01/witness_fisheye.mi'>witness_fisheye.mi</a><br />
<P><br />
If you are an experienced graphics programmer asking yourself <em>why the hell didn&#8217;t they just use a cube map for this</em>, well, there is a very good answer to that, but it involves the spoiler.  You&#8217;ll see when the game is released!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2011/01/adventures-in-fisheye-lenses/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>CVG appear to be a bunch of lousy hacks.</title>
		<link>http://the-witness.net/news/2010/12/cvg-appear-to-be-a-bunch-of-lousy-hacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cvg-appear-to-be-a-bunch-of-lousy-hacks</link>
		<comments>http://the-witness.net/news/2010/12/cvg-appear-to-be-a-bunch-of-lousy-hacks/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 23:36:43 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Ill-Advised Rants]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=701</guid>
		<description><![CDATA[Recently, on a visit to England, Chris Hecker and I did an interview with Edge magazine. It was a long interview where we spoke freely on many topics, while having a good time. Afterward, the interviewer and the editors of Edge did a very good job editing down the interview and distilling it into its [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, on a visit to England, Chris Hecker and I did an interview with <em>Edge</em> magazine.  It was a long interview where we spoke freely on many topics, while having a good time.  Afterward, the interviewer and the editors of Edge did a very good job editing down the interview and distilling it into its salient points, without distorting the substance of the discussion.</p>
<p>The final result is published in Edge issue 223.  I am very happy with it.  It is probably my favorite interview I have done during my 15 years in the game industry.  I thank Edge for the opportunity to do the interview and for their hard work in writing it up.</p>
<p>Because I like the interview so much, I should be happy when other news sites spread the word about it, right?  Apparently it is not so.  CVG just published online an article about the interview titled</p>
<p><center><strong>Braid creator: Sony takes more risks than MS with indie game choices</strong></center></p>
<p><P><br />
They fill out their article by pasting in somewhat-out-of-context quotes to support this statement (and nothing else).  To believe their account, it was a highly anti-Microsoft and pro-Sony interview.  [I am not going to link to CVG's article, because I don't want to give them hits; go find it on a search engine if you want to see it.]</p>
<p>CVG&#8217;s article is a deceptive, manipulative piece of sensationalist crap meant to drive hits by stoking the argument between Sony fans and Microsoft fans.  It misrepresents the content of the interview almost entirely. (Chris Hecker, who was <strong>half the interview</strong>, doesn&#8217;t even appear in their write-up.  This alone should make it clear that they have no interest in truthful and accurate communication.)<br />
<center><br />
<div id="attachment_706" class="wp-caption aligncenter" style="width: 419px"><a href="http://the-witness.net/news/wp-content/uploads/2010/12/edge1.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2010/12/edge1-409x384.jpg" alt="" title="edge1" width="409" height="384" class="size-large wp-image-706" /></a><p class="wp-caption-text">Chris Hecker: Half the interview!  He's even in the foreground in this picture.</p></div></center></p>
<p>For the record, here&#8217;s a list of the subjects Chris and I actually talked about:</p>
<ul>
<li>Overall trends in indie game development &#8212; where, and for how long, will indies be able to find <em>Braid</em> or <em>World of Goo</em>-sized audiences for their games?
</li>
<li>How it&#8217;s easier to make indie games, on the technical implementation side, than ever before.
</li>
<li>Small indie games versus big indie games &#8212; punk-rock-esque one-offs vs deeply exploring game design subjects.
</li>
<li>Indies ought to step up and produce higher-quality work rather than so many bad games and a few good ones.
</li>
<li>Braid is structurally a traditional game in many ways.
</li>
<li>The idea of game design as a stream of focused communication rather than a set of rules.
</li>
<li>Even the highest-selling games right now essentially sell to a niche audience.
</li>
<li>Innovation in mainstream games and how it helps drive the industry.
</li>
<li>When is an indie game really finished &#8212; how much work should you put in?
</li>
<li>Problems with the way video game education is set up right now.
</li>
<li>Most people who use the phrase &#8220;game mechanic&#8221; don&#8217;t seem to know what it means.
</li>
<li>How to see your game from the perspective of the player.
</li>
</ul>
<p>

<p>In the middle of all this, there is one bit about the way Microsoft and Sony, respectively, handle their portfolio strategies with regard to indie games.  There are positives and negatives mentioned regarding each party.  Sony does come out a bit ahead, but our discussion was much more even-handed than the confrontational CVG headline would have you believe.</p>
<p><center><br />
<div id="attachment_711" class="wp-caption aligncenter" style="width: 522px"><a href="http://the-witness.net/news/wp-content/uploads/2010/12/edge_witness.jpg"><img src="http://the-witness.net/news/wp-content/uploads/2010/12/edge_witness-512x321.jpg" alt="" title="edge_witness" width="512" height="321" class="size-large wp-image-711" /></a><p class="wp-caption-text">From CVG's write-up, you would barely even know that I talked about my company's upcoming game The Witness.</p></div></center></p>
<p>Is it the case that I said the things that CVG quotes?  Yes!  Are they an honest representation of the content of the interview?  No!  They are a dishonest and manipulative way of driving hits to CVG&#8217;s web site.</p>
<p><a href="http://chrishecker.com/Me_and_the_Wii">Chris recently wrote about this kind of treatment at the hands of journalists</a>, so rather than repeating him, I encourage you to go read that article.  I do want to point out, though, that this is not a victimless crime.</p>
<p>When this kind of hack-job is written, it hurts indie developers: it <strong>harms our relationship with our business partners like Microsoft or Sony</strong> when they think that we called an interview just to trash them in public (or when they know we didn&#8217;t really do that, but they have to deal with the PR fallout of the public thinking we did, which is just as bad.)  It <strong>harms my reputation with players</strong> because they think I called an interview just to make a big deal out of bashing Microsoft and generally being negative (which I did not do!)  It does an injustice to people who want to read about thoughtful discussions in video games; it does this not only by failing to point out the thoughtful parts of the interview, but by injecting extra noise into the sphere of discussion, making it harder for everyone to find anything thoughtful.  </p>
<p>But perhaps worst of all, CVG is crapping on their fellow journalists at Edge by depicting Edge&#8217;s hard work as tabloidesque junk.</p>
<p>Damage is clearly done, and CVG are doing this damage just so they can make a little bit of money off a few more web hits.</p>
<p>I encourage everyone out there to stop reading this kind of stuff.  It&#8217;s just misinformation; it&#8217;s worse than worthless.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/12/cvg-appear-to-be-a-bunch-of-lousy-hacks/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>The Jeffrey Roberto Concerto on Social Games</title>
		<link>http://the-witness.net/news/2010/11/the-jeffrey-roberto-concerto-on-social-games/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-jeffrey-roberto-concerto-on-social-games</link>
		<comments>http://the-witness.net/news/2010/11/the-jeffrey-roberto-concerto-on-social-games/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 05:23:04 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=698</guid>
		<description><![CDATA[Now, for the social game developers out there &#8211; let me help. You know that bad feeling you have in your stomach? &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://robertoconcerto.blogspot.com/2010/11/social-game-developers-trying-convince.html"><em>Now, for the social game developers out there &#8211; let me help. You know that bad feeling you have in your stomach? &#8230;</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/11/the-jeffrey-roberto-concerto-on-social-games/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Island Snapshot</title>
		<link>http://the-witness.net/news/2010/11/island-snapshot-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-snapshot-2</link>
		<comments>http://the-witness.net/news/2010/11/island-snapshot-2/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 04:53:13 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Progress Shots]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=692</guid>
		<description><![CDATA[It&#8217;s been a while since we&#8217;ve posted one of these&#8230; One interesting change, compared to the previous shots: you&#8217;ll notice that the lake that used to be in the center of the island, with the windmill on the edge, has moved over toward the left side and become a bay. This is one of those [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since we&#8217;ve posted one of these&#8230;<br />
<BR><P><br />
<a href="http://the-witness.net/news/?attachment_id=693" rel="attachment wp-att-693"><img src="http://the-witness.net/news/wp-content/uploads/2010/11/shot_2010.11-512x288.jpg" alt="" title="shot_2010.11" width="512" height="288" class="aligncenter size-large wp-image-693" /></a><br />
<BR><P><br />
One interesting change, compared to the previous shots: you&#8217;ll notice that the lake that used to be in the center of the island, with the windmill on the edge, has moved over toward the left side and become a bay.</p>
<p>This is one of those interesting area where design and technical constraints interact heavily.  We wanted the water of that lake to be reflective, but the way 3D graphics works, you basically need to render the entire scene an extra time in order to make a reflective surface.  For outdoor scenes this is very expensive.  Now, we also wanted some of the water out at the edge of the island to be reflective.  If the inland lake and the water near the beach were at different elevations, this would mean we need to render the entire scene twice, all the time, to generate water reflections, before rendering the main scene.  This can be optimized somewhat, but in an open-world game, there is only so much you can do.</p>
<p>The workaround to this was just to keep the inland lake at sea level, so that we can use a single rendering pass to generate all water reflections.  Technically this worked fine, but design-wise, it meant that we had to have this big spot in the middle of the island that was at sea level, while also having everything at the edge of the island being at sea level (by definition).  This gives the island a doughnut kind of shape, and given that the island is so small, this ended up severely restricting how many elevation changes can be introduced &#8212; the island was being artificially influenced to be flatter than it ought to be, because of this constraint of being sea-level in the middle.</p>
<p>So I moved that lake off to the side and connected it to the ocean.  This involved moving a couple of other areas as well.  The gameplay is preserved, and the new position is actually better for certain gameplay purposes.  The island is still pretty flat, but I think you&#8217;ll see it getting less flat over time, now.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/11/island-snapshot-2/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Experiments in Texturing</title>
		<link>http://the-witness.net/news/2010/11/experiments-in-texturing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=experiments-in-texturing</link>
		<comments>http://the-witness.net/news/2010/11/experiments-in-texturing/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 02:57:44 +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=668</guid>
		<description><![CDATA[Something like a year and a half ago, when I was starting to get serious about making The Witness, I was talking to Casey Muratori about 3D modeling and texturing. Braid was a 2D game; The Witness being 3D meant that it would be much more expensive and difficult to make, so I was doing [...]]]></description>
			<content:encoded><![CDATA[<p>Something like a year and a half ago, when I was starting to get serious about making The Witness, I was talking to <a href="http://mollyrocket.com/136">Casey Muratori</a> about 3D modeling and texturing.  Braid was a 2D game; The Witness being 3D meant that it would be much more expensive and difficult to make, so I was doing a bunch of thinking and seeking advice on the right way to do it.</p>
<p>I had been viewing a bunch of online portfolios of 3D modelers (and lamenting the quality of these portfolios) with an eye to hiring someone. Sometimes these portfolios are shown in steps: here&#8217;s the wireframe, here&#8217;s the filled-in geometry, here it is with lighting, and here is the final thing after it&#8217;s been textured.  Casey pointed out something interesting about these that I knew was true as soon as he said it: most of these portfolios look worse than they need to because the texturing ruins them.  When you run a radiosity algorithm on a scene full of unpainted geometry, it has an elegant, sophisticated, scent-of-the-real kind of thing going on; but it is very easy to spoil this sophistication through texturing.  And, it seems, in video games we have developed a tradition of &#8220;bad&#8221; texturing, whatever that means: unsubtle, unrefined, or just plain ugly.</p>
<p>We&#8217;re on a low budget here, being an indie game; so not only was it an open question how to solve the Ugly Texturing problem, but we also needed to solve it with relatively little manpower.</p>
<p>I knew that, ultimately, we could just fall back on untextured geometry with lighting, if we had good precomputed lighting.  That&#8217;s why we spent so much time and effort putting together our lighting system (as has been written about many times in this blog).  The question was, would we stick to vertex colors on most objects, or would we use some kind of texturing?</p>
<p>Early on, we identified a texturing style that would work for human-sized objects and would gel with the gameplay of The Witness.  The style prioritizes color, and tries not to break up the geometry of the object by imposing conflicting details through the texture.  We did some objects like a 1-person boat in this style in order to refine it.  [I'd like to include a screenshot of the boat here to illustrate it, but the boat is messed up right now, so I'll just have to be vague.]</p>
<p>Because that style tries to use the texture map to accentuate the object, the contents of the texture must change with the local neighborhood of the object, which means you can&#8217;t use tiling textures very much.  This means it would be very expensive to texture something like a big building, since you&#8217;d need unique texels everywhere.</p>
<p>Thankfully, the Western game development world has a tradition of developers being very open with their techniques and processes, and communicating with other developers very honestly about what is effective.  (This is not something that one finds elsewhere in the world, and we should work hard to keep that spirit alive because it benefits everyone; but that&#8217;s a totally separate rant.)  Here&#8217;s one good example of this kind of information exchange: at the GDC this year, some guys from Naughty Dog gave a talk on the art direction for Uncharted 2 (<a href="http://cmpmedia.vo.llnwd.net/o1/vault/gdc10/slides/Pangilinan_Erick_Uncharted2ArtDirection.pdf">pdf link to their slides here</a>.)  Somewhere around page 220 of this very informative slideshow, they start talking about the blend shaders that they use in order to give more character to buildings and other geometry while still using tiling textures.  The idea is that you interpolate between two (or more) textures with a blend function that fits the shape of your building nicely.  You put some smarts into the interpolation so that it produces something that is visually interesting, rather than the blurry mess you would get via naive interpolation.</p>
<p>For The Witness it seemed like a good idea to use this kind of technique, but in a minimalist way, to create patterns that accentuate the shapes of buildings, and help tie them together visually, without stumbling into the realm of Ugly Texturing.</p>
<p>(There are a lot of reasons for the minimalism; one reason, though, is to provide clarity about what you can interact with, versus what is inert.  Interactive things are colored in a way that makes them stand out in an obvious way.  Think of it as something like what Mirror&#8217;s Edge did, but in a different way.)</p>
<p>We&#8217;ve started experimenting with these blend shaders; here are some images:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/11/one_vs_two_tones.jpg"><img class="aligncenter size-large wp-image-670" title="one_vs_two_tones" src="http://the-witness.net/news/wp-content/uploads/2010/11/one_vs_two_tones-512x384.jpg" alt="" width="512" height="384" /></a></p>
<p>The upper-left shows a scene before we implemented the blend shader for buildings.  In the upper-right, we are using a blend shader that blends the original texture with an alternate one that is a bit darker and rougher (but the difference is a bit subtle, by game standards at least).  Below these images are the same scenes with precomputed lighting mixed in.</p>
<p>It is pretty clear to me that the lighting is actually the biggest ingredient in tying the scene together, but the blend shader is, I think, a good extra kick.  It helps the area feel like there is a little bit of life and history to it (for example, the lighter-colored paths near the puzzle panels in the foreground, which imply that people have been walking that way).  What you see here is not of shipping quality, but I see how we can reach shipping quality by iterating on this style and putting production-level effort into the assets.</p>
<p>Here&#8217;s a close-up of what the stairway looks like:</p>
<p style="text-align: center;"><a href="http://the-witness.net/news/wp-content/uploads/2010/11/closeups.jpg"><img class="aligncenter size-large wp-image-671" title="closeups" src="http://the-witness.net/news/wp-content/uploads/2010/11/closeups-256x384.jpg" alt="" width="256" height="384" /></a></p>
<p>As you can see, the texture maps have some grain to them; from far away, the grain melts away and the structure is mostly a solid color, accented by lighting.</p>
<p>These experiments are still early yet but I find them very promising.  The plan is that we will continue to hone the style and end up with something very special.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/11/experiments-in-texturing/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>A new lecture about game design.</title>
		<link>http://the-witness.net/news/2010/10/a-new-lecture-about-game-design/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-new-lecture-about-game-design</link>
		<comments>http://the-witness.net/news/2010/10/a-new-lecture-about-game-design/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 06:19:27 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=650</guid>
		<description><![CDATA[This talk is called Games and the Human Condition; it was given at Rice University on September 27, 2010. It&#8217;s about &#8220;best practices&#8221; of modern game design that I find unsettling, and the way in which &#8220;social games&#8221; and &#8220;gamification&#8221; are destructive. A full video is available from this page at Rice University. Here&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://the-witness.net/news/wp-content/uploads/2010/10/cover-512x288.jpg" alt="" title="cover" width="512" height="288" class="aligncenter size-large wp-image-652" /></p>
<p>
<p>
<p>
This talk is called <strong>Games and the Human Condition</strong></em>; it was given at Rice University on September 27, 2010.  It&#8217;s about &#8220;best practices&#8221; of modern game design that I find unsettling, and the way in which &#8220;social games&#8221; and &#8220;gamification&#8221; are destructive.</p>
<p>A full video is available from <a href="http://edtech.rice.edu/cms/?option=com_iwebcast&#038;task=webcast&#038;action=details&#038;event=2349">this page at Rice University</a>.</p>
<p>Here&#8217;s a link containing <a href="http://number-none.com/blow/slides/games_and_the_human_condition.ppt">just the slides (ppt format)</a>.</p>
<p>Here&#8217;s a long and wordy abstract:</p>
<p>Video games have evolved tremendously over the past few decades; they&#8217;re much more entertaining than they used to be. That is not by accident; we, the community of game designers, have been continuously refining our techniques. The most common way we do this is by testing out our games on you, the players, and optimizing for the &#8220;best&#8221; result (where &#8220;best&#8221; is defined by us). As this process is ongoing, what kind of relationship exists between the designer and the player? Is it artist/audience, experimenter/subject, entrepreneur/customer, or tycoon/resource? Invariably it&#8217;s some admixture of these things, the particular ratios for a given game being chosen by its designers (usually without awareness that a decision is being made). Today, due to the way the Internet is widely used, and because game designers are becoming more serious about certain aspects of their craft, the iteration time of this game design optimization process is shorter than ever before: designers can observe their players much more thoroughly, and more quickly, than they ever have in the past. At some point a quantitative change becomes a qualitative one: the result of all this competency may be heavily destructive. Some aspects of the current notion of &#8220;good game design&#8221; may in fact be very bad, or at least indefensible, from an ethical standpoint. Today&#8217;s &#8220;better&#8221; video games spend a great deal of effort to undermine defenses that took you tens of millennia to evolve. They tend to be successful at this. As designers keep evolving their craft and gain greater analytical power, what will happen? </p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/10/a-new-lecture-about-game-design/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>About the Blue Mazes</title>
		<link>http://the-witness.net/news/2010/10/about-the-blue-mazes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=about-the-blue-mazes</link>
		<comments>http://the-witness.net/news/2010/10/about-the-blue-mazes/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 02:20:50 +0000</pubDate>
		<dc:creator>Jonathan Blow</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=640</guid>
		<description><![CDATA[Just after PAX, Stephen Totilo posted a video at Kotaku showing some gameplay of The Witness. This is video from the start of the game and shows some basic stuff, including a set of blue mazes mounted on poles and on walls, that the player must solve to proceed. I&#8217;ve seen mixed reactions to these [...]]]></description>
			<content:encoded><![CDATA[<p>Just after PAX, <a href="http://www.kotaku.com.au/2010/09/tantalising-session-with-the-witness-the-next-game-from-the-creator-of-braid/">Stephen Totilo posted a video at Kotaku showing some gameplay of The Witness</a>.  This is video from the start of the game and shows some basic stuff, including a set of blue mazes mounted on poles and on walls, that the player must solve to proceed.</p>
<p><a href="http://the-witness.net/news/?attachment_id=641" rel="attachment wp-att-641"><img src="http://the-witness.net/news/wp-content/uploads/2010/10/maze-300x168.png" alt="" title="maze" width="300" height="168" class="aligncenter size-medium wp-image-641" /></a></p>
<p>I&#8217;ve seen mixed reactions to these mazes and to the gameplay shown in the video.  Some people seem to have jumped to the conclusion that the game is going to be about solving simple maze puzzles, and thus not be particularly exciting.</p>
<p>If that thought crosses your mind, all I can ask is to have faith.  I wouldn&#8217;t make a game about solving a series of rote puzzles.  The footage came from the beginning of the game because we don&#8217;t want to spoil anything major.  But even this beginning-of-the-game stuff has more to it than meets the eye.</p>
<p>It&#8217;s like Braid, in a way.  Back before Braid was released, I never made a trailer video for it, because I couldn&#8217;t come up with a way to show in video form what the game was about.  You can show some rewinding happening, or other funky time stuff, sure, but what is cool about Braid is not the mechanics of those things or how they look on the screen.  What is cool about Braid is what happens in the player&#8217;s mind during the puzzle-solving process.  The time stuff is the method by which that is implemented, but the rules of time manipulation do not contain the magic.  Watching a video, it&#8217;s nearly impossible to see the magic.  You have to play the game to see the magic.</p>
<p>The Witness is like that too.  The blue mazes are a major aspect of the game, but they are not the point.  The point is the magic that happens in the player&#8217;s mind when he understands the subtle things that the mazes are saying &#8212; because the mazes aren&#8217;t just puzzles, they are lines of communication that aggregate, become more complex and eventually say surprising things.  This can&#8217;t be seen in a video; you have to play it to have the experience.  The magic is in the player&#8217;s head, not on the screen.</p>
<p>The only two guys who have played The Witness to completion have said it will be better than Braid when it is done.  I am certainly not going to jump up and down and say &#8220;hey this game is better than Braid&#8221;, or even claim that Braid is good.  But I just want to put that out there as reassurance to those of you who are worried about that gameplay video.  </p>
<p>I have a file with about 80 game ideas in it, most of which would probably make really good games.  But I can only make one game at a time right now, so I had to pick one.  I picked The Witness, even though it more difficult and expensive to make than most of the other ideas, because I was more excited about the core concept of The Witness than about the other 79 ideas.  This is a highly ambitious game that stretches my ability as a game designer to its limit.</p>
<p>So if you don&#8217;t yet see why the game is ambitious or exciting, please have patience!  We&#8217;ll be releasing more information as the game comes closer to completion&#8230;</p>
<p>And whatever you think about what you&#8217;ve seen so far, I&#8217;d like to thank you for your interest in the game!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/10/about-the-blue-mazes/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Hemicube Rendering and Integration</title>
		<link>http://the-witness.net/news/2010/09/hemicube-rendering-and-integration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hemicube-rendering-and-integration</link>
		<comments>http://the-witness.net/news/2010/09/hemicube-rendering-and-integration/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 00:26:54 +0000</pubDate>
		<dc:creator>Ignacio Castaño</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=244</guid>
		<description><![CDATA[One of our aims with our global illumination implementation was to keep it as simple as possible, while still obtaining good performance, and we hoped to achieve that by using the GPU. While the are several approaches to compute global illumination in the GPU, the most simple one that we could come up with was [...]]]></description>
			<content:encoded><![CDATA[<p>One of our aims with our global illumination implementation was to keep it as simple as possible, while still obtaining good performance, and we hoped to achieve that by using the GPU. While the are several approaches to compute global illumination in the GPU, the most simple one that we could come up with was to use our existing rendering engine to estimate global illumination using a fixed sequence of final gathering steps. That is, rendering the scene from every lightmap texel to gather all the incoming irradiance at that point, integrating it to compute the output radiance, and repeating these steps multiple times until the lightmaps converge to an approximate solution. This is basically the same <a href="http://freespace.virgin.net/hugo.elias/radiosity/radiosity.htm">procedure described by Hugo Elias</a>.</p>
<p><img class="aligncenter size-full wp-image-588" src="http://the-witness.net/news/wp-content/uploads/2010/09/pretty_shot.png" alt="" width="512" height="288" /></p>
<p>Using the same engine makes it very easy to keep the global illumination in sync with the rest of the game. If we add new shaders or materials, change the representation of the geometry or alter the world, keeping the global illumination up to date requires little o no effort. Another interesting benefit is that optimizations to the rendering engine also benefit the global illumination pre-computation. However, as we will see later, in practice each application stresses the system in different ways and end up limited by different bottlenecks, what improves the rendering time does not necessary improve the pre-computation and vice-versa.</p>
<p><span id="more-244"></span></p>
<h3>Projection Methods</h3>
<p>I tried several different approaches to render the scene and estimate the incoming radiance. The most common approach is to render hemicubes; that requires rendering the scene to 5 different viewports. Several sources suggested the use of spherical or parabolic projections, but in my experience these approaches produced terrible results due to the non linear projection. Without very high tessellation rates the scene would become unacceptably distorted, creating gaps between objects or making parallel surfaces self-intersect.</p>
<p><img class="aligncenter size-full wp-image-628" src="http://the-witness.net/news/wp-content/uploads/2010/09/spherical_paraboloid.png" alt="" width="520" height="278" /></p>
<p>In <a href="http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter39.html">GPU Gems 2, Coombe et al.</a> suggested to project the z value independently of (x,y) coordinates using an orthographic projection in order to maintain a correct depth ordering. As seen in the next picture, that removed the most obvious artifacts; note how the staircase inside the tower is not visible anymore:</p>
<p><img class="aligncenter size-full wp-image-622" src="http://the-witness.net/news/wp-content/uploads/2010/09/paraboloid_orthographic.png" alt="" width="256" height="256" /></p>
<p>However, while this works OK from some points of view, the distortion becomes unacceptable when the camera is close to a surface, which is always our case. So, in practice these approaches are not very useful. Note how the outdoors are visible when sampling the lighting from the interior of the tower:</p>
<p><img class="aligncenter size-full wp-image-624" src="http://the-witness.net/news/wp-content/uploads/2010/09/paraboloid_artifacts.png" alt="" width="256" height="256" /></p>
<p>Other implementations use a single plane projection. This kind of projection does not capture the whole hemisphere, but by using a wide field of view it&#8217;s possible to capture about 80% of it. I haven&#8217;t actually tried this approach, but to get an idea of what the results would look like, I modified the hemicube integrator to ignore 20% of the samples near the horizon and found out that this introduced artifacts that were unacceptable for high-quality results.</p>
<p><a href="http://www.graphics.cornell.edu/~jaroslav/papers/2008-irradiance_caching_class/08-pascal-gpu-notes.pdf">Pascal Gautron</a> estimates that on typical scenes this approach introduced a 18% RMS error, but suggests various tricks to reduce it by re-balancing the solid angle weights, or extrapolating the border samples and filling the holes. The latter method reduces the error down to a mere 6%.</p>
<p>However, these improvements do not eliminate banding artifacts caused when an intense light source visible from one location is suddenly not visible anymore in the next when it falls out of the projection frustum. To make things worse, the projection lacks rotational invariance, which enhances the problem when hemicubes are rendered with random rotations. So, while in many cases the results look alright, the few cases that do not render the method impractical.</p>
<p>Another problem is that the wide frustum is 4 times larger than the equivalent hemicube and easily intersects with the surrounding geometry; as I&#8217;ll discuss next, this is one of the main problems that I had to deal with.</p>
<p>In the end I simply stayed with the traditional hemicubes for simplicity. I think it would have been possible to do somewhat better using a fancy tetrahedral or pyramidal projection with 3 or 4 planes, but that didn&#8217;t seem worth the trouble.</p>
<h3>Hemicube Overlaps</h3>
<p>As I just mentioned, one of the main problems that I had to solve was to handle overlaps between the hemicubes and the geometry. These overlaps are unavoidable unless you impose some severe modeling restrictions that are not desirable for production.</p>
<p>When the geometry is well formed and does not have self-intersections, these overlaps can sometimes be avoided with centroid sampling. Without centroid sampling the location where the hemicube is rendered from can easily end up being outside of the polygon that contains the sample and thus inside another volume.</p>
<p><img class="aligncenter white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/centroid21.png" border="0" alt="centroid sampling" width="490" height="231" /></p>
<p>With centroid sampling the origin of the hemicube is now always inside the surface. However, it can still be very close to the surface boundary and have overlaps with nearby surfaces. A simple solution is to move the near plane closer to the camera until the overlap dissapears, but how close? The distance to the nearest boundary can be determined analytically, but there&#8217;s a limit in how much the near plane distance can be reduced without introducing depth sampling artifacts. An interesting solution for this problem is to render multiple hemicubes at the same location, each hemicube enclosing the previous one with its far plane at the near plane of the next.</p>
<p><img class="aligncenter white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/hemicubes1.png" border="0" alt="hemicubes" width="235" height="170" /></p>
<p>That would solve most the problems when the geometry is watertight and centroid sampling is used, but in many cases our assets are not always well conditioned. So, I had to find a more general solution.</p>
<p>I tried all sort of heuristics, to render backfaces in black, to fill them with the average color, to extrapolate the nearest colors, etc. None of these solutions worked well in all cases. In the end, something that produced satisfactory results was to render the backfaces with a special tag to distinguish them from front facing faces when integrating the hemicubes. Whenever a hemicube had too many tagged texels it would be discarded entirely, and instead its output radiance would be estimated at that location interpolating or extrapolating it from the nearest valid samples.</p>
<p>The extrapolation is not always correct, and the detection of invalid hemicubes is not 100% accurate, but so far this is the method that I&#8217;m happiest with. In the next article I&#8217;ll explain how this extrapolation is done in more detail.</p>
<h3>Shadow Rendering</h3>
<p>While the goal was to use the same rendering engine, using its shadow system &#8216;as is&#8217; would have been overkill. We are using <a href="http://the-witness.net/news/?p=77">cascade shadow maps</a>, which are updated on every frame, and to maximize the shadow map resolution the shadow maps are tightly aligned to the view frustum slices. When rendering the hemicubes, shadow map resolution is not that important, and re-rendering the shadows for each hemicube face is unnecessarily expensive. To keep things simple I still used cascade shadow maps, but instead of rendering them for each view, I only rendered them once for each object positioning the cascades around the center of the object.</p>
<h3>Rasterization</h3>
<p>Now that I&#8217;ve explained how to capture the irradiance of the scene at any point, it&#8217;s necessary to sample it for every lightmap texel. To do that I simply rasterize the geometry in the lightmap UV space using a conservative rasterizer and render one hemicube at every fragment whose coverage is above certain threshold.</p>
<p>One nice thing of using our own rasterizer is that I can evaluate the exact coverage analytically. Since the parameterization does not have overlaps, the coverage is just the area of the intersection of the texel square with the polygon being rasterized. Similarly, the centroid is the center of mass of the clipped polygon.</p>
<p>This approach gives us a position and a direction to render the hemicube from, but I still need to determine the orientation of the hemicube. Initially, I simply chose an arbitrary orientation using <a href="http://sourceforge.net/mailarchive/message.php?msg_name=3.0.6.32.20001111143758.010fcdf8%40208.55.130.3">the traditional/standard method</a>, but that resulted in banding artifacts:</p>
<p><img class="aligncenter size-full wp-image-607 white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/banding_small_00.png" alt="" width="320" height="180" /></p>
<p>The source of the problem is just the limited hemicube resolution, but it&#8217;s surprisingly hard to get rid of it entirely by only increasing the hemicube size. A better solution is to simply use random orientations:</p>
<p><img class="aligncenter size-full wp-image-608 white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/noise_small_00.png" alt="" width="320" height="180" /></p>
<p>Note that I am trading banding artifacts by noise, but the latter is much easier to get rid of by using some smoothing.</p>
<h3>Integration</h3>
<p>Once the hemicubes have been rendered it&#8217;s necessary to integrate the sampled irradiance to compute the output radiance. The integral of the irradiance hemicube is simply a weighted sum of the samples, where the weights are the cosine-weighted areas of the hemicube texels projected on the hemisphere, that is, the cosine-weighted solid angles of the texels. These weights are constant, so they can be precomputed in advance.</p>
<p>In the <a href="http://freespace.virgin.net/hugo.elias/radiosity/radiosity.htm">article by Hugo Helias</a> that I referenced in the introduction the same approach is used and this weight table is called the &#8220;The Multiplier Map&#8221;. Beware of that part of the article, though, because there&#8217;s a bug in the formulas. The subtended solid angle of the texel is not &#8220;the cosine of the angle between the direction the camera is facing in, and the line from the camera to the pixel&#8221;:</p>
<p><img class="white-background" style="float: right;" src="http://the-witness.net/news/wp-content/uploads/2010/09/global_illumiantion_compendium.png" border="0" alt="global_illumiantion_compendium.png" width="275" height="141" /><img class="white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/texel_solid_angle_bad.gif" border="0" alt="texel_solid_angle_bad.gif" width="129" height="20" /></p>
<p>That term needs to be divided by the squared distance between the location of the camera <code>x</code> and the center of the texel <code>y</code>:</p>
<p><img class="white-background" src="http://the-witness.net/news/wp-content/uploads/2010/09/texel_solid_angle_good.gif" border="0" alt="texel_solid_angle_good.gif" width="133" height="46" /></p>
<p>See formula 25 in the <a href="http://people.cs.kuleuven.be/~philip.dutre/GI/">Global Illumination Compendium</a> for more details.</p>
<p>Also, since this is a precomputation it made sense to evaluate the solid angle exactly. That can be derived using Girard&#8217;s formula or directly using the handy formula in <a href="http://www.fizzmoll11.com/thesis/">Manne Ohrstrom&#8217;s thesis</a>. Doing so improved the invariance of the integral with respect to rotations of the hemicube and that reduced noise significantly.</p>
<p>In the end, the integration is a fairly simple operation. It could be done very efficiently using compute shaders and I might still do that in the future, but for prototyping purposes it was much easier to perform the integration in the CPU. Unfortunately, that required transferring the data across the bus and, if not done properly, it severely reduced performance.</p>
<h3>Asynchronous Memory Transfers</h3>
<p>Contrary to popular belief, Direct3D 9 provides a mechanism to perform memory copies asynchronously. In Direct3D 10 and OpenGL this is done through staging resources or pixel buffer objects; in Direct3D 9 something similar can be achieved with offscreen plain surfaces. The problem is that this is not very well documented, it&#8217;s very easy to fall out of the fast path, and the conditions in which that happens are slightly different for each IHV.</p>
<p>In the first place, you have to create two render targets and offscreen plain surfaces:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">dev<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>CreateRenderTarget<span style="color: #008000;">&#40;</span>..., <span style="color: #000040;">&amp;</span>render_target_0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
dev<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>CreateRenderTarget<span style="color: #008000;">&#40;</span>..., <span style="color: #000040;">&amp;</span>render_target_1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
dev<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>CreateOffscreenPlainSurface<span style="color: #008000;">&#40;</span>..., <span style="color: #000040;">&amp;</span>offscreen_surface_0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
dev<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>CreateOffscreenPlainSurface<span style="color: #008000;">&#40;</span>..., <span style="color: #000040;">&amp;</span>offscreen_surface_1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p></code></p>
<p>If you have more than two targets the copies become synchronous in some systems, but two is sufficient to generate enough work to do in parallel with the memory transfers.</p>
<p>The most important observation is that the only device method that appears to be asynchronous is <code>GetRenderTargetData</code>. After calling this method, any other device method blocks until the copy is complete. So, instead of overlapping the memory transfer with the rendering code, you have to find some CPU work to do simultaneously. In my case, I just do the integration of one of the render targets while copying the other:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">while</span> hemicubes left <span style="color: #008000;">&#123;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span> <span style="color: #666666;">// Render hemicube to render_target_0</span>
&nbsp;
    <span style="color: #666666;">// Initiate asynchronous copy to system memory.</span>
    dev<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>GetRenderTargetData<span style="color: #008000;">&#40;</span>render_target_0, offscreen_surface_0<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #666666;">// Lock offscreen_surface_1</span>
    <span style="color: #666666;">// at this point the corresponding async copy has finished already.</span>
    offscreen_surface_1<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>LockRect<span style="color: #008000;">&#40;</span>..., D3DLOCK_READONLY<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span> <span style="color: #666666;">// Integrate hemicube.</span>
&nbsp;
    offscreen_surface_1<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>UnlockRect<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    swap<span style="color: #008000;">&#40;</span>render_target_0, render_target_1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    swap<span style="color: #008000;">&#40;</span>offscreen_surface_0, offscreen_surface_1<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<p>Another problem is that the buffer needs to be sufficiently big to reach transfer rates that saturate the available bandwidth. In order to achieve that I batch multiple hemicubes in a single texture atlas as seen in the following picture:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/04/hemicube_atlas.png"><img class="aligncenter size-medium wp-image-318" src="http://the-witness.net/news/wp-content/uploads/2010/04/hemicube_atlas-300x300.png" alt="" width="300" height="300" /></a></p>
<p>In practice I do not render the hemicubes using the depicted cross layout, but instead arrange the faces tightly in a 3&#215;1 rectangle that does not waste any texture space and maximizes bandwidth. However, the cross layout was useful to visualize the output for debugging purposes.</p>
<h3>Performance and Conclusions</h3>
<p>The performance of our global illumination solution is somewhat disappointing. While we do most of the work on the GPU we are not really making a very effective use of it. The main GPU bottleneck is in the fixed function geometry pipeline; we are basically rendering a large number of tiny triangles on a small render target.</p>
<p>But that&#8217;s not the main problem. Traversing the scene in the CPU and submitting commands to render it actually takes more time than it takes the GPU to process the commands and render the scene, so the GPU is actually underutilized.</p>
<p>Our engine was designed for quick prototyping, to make it very easy to draw stuff with different materials, but not to do so in the most efficient way possible. These inefficiencies became a lot more pronounced in the lightmap baker.</p>
<p>On the bright side, as we optimize the CPU side of the engine we expect performance to improve. Modern GPUs also have functionality that make it possible to render to multiple hemicube faces at once. We expect that will also reduce the CPU work significantly.</p>
<p>While it was easy to get our global illumination solution up and running by reusing our rendering engine, bringing it to a level of sufficient quality and performance took a considerable amount of time. In the next installment I&#8217;ll describe some of the techniques and optimizations that I implemented to fix some of the remaining artifacts and improve performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/09/hemicube-rendering-and-integration/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Computing Alpha Mipmaps</title>
		<link>http://the-witness.net/news/2010/09/computing-alpha-mipmaps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=computing-alpha-mipmaps</link>
		<comments>http://the-witness.net/news/2010/09/computing-alpha-mipmaps/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 00:59:02 +0000</pubDate>
		<dc:creator>Ignacio Castaño</dc:creator>
				<category><![CDATA[Engine Tech]]></category>

		<guid isPermaLink="false">http://the-witness.net/news/?p=484</guid>
		<description><![CDATA[A little problem that we had when we started to create trees and vegetation is that the standard mipmap generation algorithms produced surprisingly bad results on alpha tested textures. As the trees moved farther away from the camera, the leafs faded out becoming almost transparent. Here&#8217;s an example. The following tree looked OK close to [...]]]></description>
			<content:encoded><![CDATA[<p>A little problem that we had when we started to create trees and vegetation is that the standard mipmap generation algorithms produced surprisingly bad results on alpha tested textures. As the trees moved farther away from the camera, the leafs faded out becoming almost transparent.</p>
<p>Here&#8217;s an example. The following tree looked OK close to the camera:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/near_nocoverage.png"><img class="aligncenter size-large wp-image-495" src="http://the-witness.net/news/wp-content/uploads/2010/09/near_nocoverage-512x320.png" alt="" width="512" height="320" /></a></p>
<p><span id="more-484"></span></p>
<p>but as we moved away, the leafs started to fade and thin out:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/mid_nocoverage.png"><img class="aligncenter size-large wp-image-493" src="http://the-witness.net/news/wp-content/uploads/2010/09/mid_nocoverage-512x320.png" alt="" width="512" height="320" /></a></p>
<p>until they almost disappeared:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/far_nocoverage.png"><img class="aligncenter size-large wp-image-491" src="http://the-witness.net/news/wp-content/uploads/2010/09/far_nocoverage-512x320.png" alt="" width="512" height="320" /></a></p>
<p>I had never encountered this problem before, neither had I heard much about it, but after a few google searches I found out that artists are often frustrated by it and usually work around the issue using <a href="http://www.polycount.com/forum/showthread.php?t=65261">various</a> <a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=540726">hacks</a>. These are some of the proposed solutions that are usually suggested:</p>
<ul>
<li>Manually adjusting contrast and sharpening the alpha channel of each mipmap in Photoshop.</li>
<li>Scaling the alpha in the shader based on distance or on an lod factor estimated using texture gradients.</li>
<li>Limiting the number of mipmaps, so that the lowest ones aren&#8217;t used by the game.</li>
</ul>
<p><P><br />
These solutions may work around the problem in one way or another, but none of them is entirely correct and in some cases add a significant overhead.</p>
<p>In order to address the problem it&#8217;s important to understand why the geometry fades out in the distance. That is because when computing alpha mipmaps using the standard algorithms, each mipmap has a different alpha test coverage. That is, the proportion of pixels that pass the alpha test changes, in most cases going down and causing the texture to become more transparent.</p>
<p>A simple solution to the problem is to find a scale factor that preserves the original alpha test coverage as best as possible. We define the coverage of the first mipmap as follows:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">coverage <span style="color: #000080;">=</span> Sum<span style="color: #008000;">&#40;</span>a_i <span style="color: #000040;">&amp;</span>gt<span style="color: #008080;">;</span> A_r<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> N</pre></div></div>

<p></code></p>
<p>where <code>A_r</code> is the alpha test value used in your application, <code>a_i</code> are the alpha values of the mipmap, and <code>N</code> is the number of texels in the mipmap. Then, for the following mipmaps you want to find a scale factor that causes the resulting coverage to stay the same:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Sum<span style="color: #008000;">&#40;</span>scale <span style="color: #000040;">*</span> a_i <span style="color: #000040;">&amp;</span>gt<span style="color: #008080;">;</span> A_r<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> N <span style="color: #000080;">==</span> coverage</pre></div></div>

<p></code></p>
<p>However, finding this <code>scale</code> directly is tricky because it&#8217;s a discrete problem, in general, there&#8217;s no exact solution, and the range of <code>scale</code> is unbounded. Instead, what you can do is to find a new alpha reference value <code>a_r</code> that produces the desired coverage:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Sum<span style="color: #008000;">&#40;</span>a_i <span style="color: #000040;">&amp;</span>gt<span style="color: #008080;">;</span> a_r<span style="color: #008000;">&#41;</span> <span style="color: #000040;">/</span> N <span style="color: #000080;">=</span> coverage</pre></div></div>

<p></code></p>
<p>This is much easier to solve, because <code>a_r</code> is bounded between 0 and 1. So, it&#8217;s possible to use a simple bisection search to find the best solution. Once you know <code>a_r</code> the scale is simply:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">scale <span style="color: #000080;">=</span> A_r <span style="color: #000040;">/</span> a_r</pre></div></div>

<p></code></p>
<p>An implementation of this algorithm is publicly available in <a href="http://code.google.com/p/nvidia-texture-tools/">NVTT</a>. The relevant code can be found in the following methods of the FloatImage class:</p>
<p><code>float FloatImage::<a href="http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp#985">alphaTestCoverage</a>(float alphaRef, int alphaChannel) const;<br />
void FloatImage::<a href="http://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp#1002">scaleAlphaToCoverage</a>(float desiredCoverage, float alphaRef, int alphaChannel);<br />
</code></p>
<p>And here&#8217;s a simple example of how this feature can be used through NVTT&#8217;s public API:<br />
<code> </code></p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Output first mipmap.</span>
context.<span style="color: #007788;">compress</span><span style="color: #008000;">&#40;</span>image, compressionOptions, outputOptions<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Estimate original coverage.</span>
<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">float</span> coverage <span style="color: #000080;">=</span> image.<span style="color: #007788;">alphaTestCoverage</span><span style="color: #008000;">&#40;</span>A_r<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Build mipmaps and scale alpha to preserve original coverage.</span>
<span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>image.<span style="color: #007788;">buildNextMipmap</span><span style="color: #008000;">&#40;</span>nvtt<span style="color: #008080;">::</span><span style="color: #007788;">MipmapFilter_Kaiser</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    image.<span style="color: #007788;">scaleAlphaToCoverage</span><span style="color: #008000;">&#40;</span>coverage, A_r<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    context.<span style="color: #007788;">compress</span><span style="color: #008000;">&#40;</span>tmpImage, compressionOptions, outputOptions<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p></code></p>
<p>As seen in the following screenshot, this solves the problem entirely:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/mid_coverage.png"><img class="aligncenter size-large wp-image-492" src="http://the-witness.net/news/wp-content/uploads/2010/09/mid_coverage-512x320.png" alt="" width="512" height="320" /></a></p>
<p>even when the trees are far away from the camera:</p>
<p><a href="http://the-witness.net/news/wp-content/uploads/2010/09/far_coverage.png"><img class="aligncenter size-large wp-image-490" src="http://the-witness.net/news/wp-content/uploads/2010/09/far_coverage-512x320.png" alt="" width="512" height="320" /></a></p>
<p>Note that this problem does not only show up when using alpha testing, but also when using alpha to coverage (as in these screenshots) or alpha blending in general. In those cases you don&#8217;t have a specific alpha reference value, but this algorithm still works fine if you choose a value that is close to 1, since essentially what you want is to preserve the percentage of texels that are nearly opaque.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-witness.net/news/2010/09/computing-alpha-mipmaps/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>We showed The Witness secretly at PAX&#8230; in plain sight.</title>
		<link>http://the-witness.net/news/2010/09/we-showed-the-witness-secretly-at-pax/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=we-showed-the-witness-secretly-at-pax</link>
		<comments>http://the-witness.net/news/2010/09/we-showed-the-witness-secretly-at-pax/#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 [...]]]></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/2010/09/we-showed-the-witness-secretly-at-pax/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Design Charrette</title>
		<link>http://the-witness.net/news/2010/08/design-charrette/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=design-charrette</link>
		<comments>http://the-witness.net/news/2010/08/design-charrette/#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/2010/08/design-charrette/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Island Paint-Over</title>
		<link>http://the-witness.net/news/2010/08/island-paint-over/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-paint-over</link>
		<comments>http://the-witness.net/news/2010/08/island-paint-over/#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/2010/08/island-paint-over/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Island Shrinkage</title>
		<link>http://the-witness.net/news/2010/08/island-shrinkage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-shrinkage</link>
		<comments>http://the-witness.net/news/2010/08/island-shrinkage/#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 [...]]]></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/2010/08/island-shrinkage/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Why aren&#8217;t video games satisfying?</title>
		<link>http://the-witness.net/news/2010/08/why-arent-video-games-satisfying/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-arent-video-games-satisfying</link>
		<comments>http://the-witness.net/news/2010/08/why-arent-video-games-satisfying/#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 [...]]]></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/2010/08/why-arent-video-games-satisfying/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Braid: A Movement Piece</title>
		<link>http://the-witness.net/news/2010/08/braid-a-movement-piece/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=braid-a-movement-piece</link>
		<comments>http://the-witness.net/news/2010/08/braid-a-movement-piece/#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/2010/08/braid-a-movement-piece/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Island Today</title>
		<link>http://the-witness.net/news/2010/08/the-island-today/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-island-today</link>
		<comments>http://the-witness.net/news/2010/08/the-island-today/#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/2010/08/the-island-today/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>A game to watch for: Miegakure</title>
		<link>http://the-witness.net/news/2010/07/a-game-to-watch-for-miegakure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-game-to-watch-for-miegakure</link>
		<comments>http://the-witness.net/news/2010/07/a-game-to-watch-for-miegakure/#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 the Year, [...]]]></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/2010/07/a-game-to-watch-for-miegakure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Hey, who is making this game?</title>
		<link>http://the-witness.net/news/2010/07/hey-who-is-making-this-game/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hey-who-is-making-this-game</link>
		<comments>http://the-witness.net/news/2010/07/hey-who-is-making-this-game/#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/2010/07/hey-who-is-making-this-game/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Location Development</title>
		<link>http://the-witness.net/news/2010/07/location-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=location-development</link>
		<comments>http://the-witness.net/news/2010/07/location-development/#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, [...]]]></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>
<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>

<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/2010/07/location-development/feed/</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/2010/07/the-indie-fund-submissions-process-is-now-open/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-indie-fund-submissions-process-is-now-open</link>
		<comments>http://the-witness.net/news/2010/07/the-indie-fund-submissions-process-is-now-open/#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 [...]]]></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/2010/07/the-indie-fund-submissions-process-is-now-open/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Island Snapshot</title>
		<link>http://the-witness.net/news/2010/06/island-snapshot/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=island-snapshot</link>
		<comments>http://the-witness.net/news/2010/06/island-snapshot/#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/2010/06/island-snapshot/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Kriging is cool.</title>
		<link>http://the-witness.net/news/2010/05/kriging-is-cool/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=kriging-is-cool</link>
		<comments>http://the-witness.net/news/2010/05/kriging-is-cool/#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/2010/05/kriging-is-cool/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>The island this week.</title>
		<link>http://the-witness.net/news/2010/05/the-island-this-week/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-island-this-week</link>
		<comments>http://the-witness.net/news/2010/05/the-island-this-week/#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/2010/05/the-island-this-week/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>The island so far&#8230;</title>
		<link>http://the-witness.net/news/2010/04/the-island-so-far/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-island-so-far</link>
		<comments>http://the-witness.net/news/2010/04/the-island-so-far/#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 [...]]]></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/2010/04/the-island-so-far/feed/</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/2010/04/graphics-tech-shadow-maps-part-2-save-25-texture-memory-and-possibly-much-more/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-shadow-maps-part-2-save-25-texture-memory-and-possibly-much-more</link>
		<comments>http://the-witness.net/news/2010/04/graphics-tech-shadow-maps-part-2-save-25-texture-memory-and-possibly-much-more/#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 [...]]]></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>&#8216;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&#8242;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/2010/04/graphics-tech-shadow-maps-part-2-save-25-texture-memory-and-possibly-much-more/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Multi-lightmaps</title>
		<link>http://the-witness.net/news/2010/04/graphics-tech-multi-lightmaps/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-multi-lightmaps</link>
		<comments>http://the-witness.net/news/2010/04/graphics-tech-multi-lightmaps/#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">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://the-witness.net/news/2010/04/graphics-tech-multi-lightmaps/?show=slide">
			[Show as slideshow]		</a>
	</div>

	
	<!-- 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/2010/04/graphics-tech-multi-lightmaps/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Lightmap Parameterization</title>
		<link>http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-texture-parameterization</link>
		<comments>http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/#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, [...]]]></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/2010/03/graphics-tech-texture-parameterization/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Lighting Comparison</title>
		<link>http://the-witness.net/news/2010/03/graphics-tech-lighting-comparison/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-lighting-comparison</link>
		<comments>http://the-witness.net/news/2010/03/graphics-tech-lighting-comparison/#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 [...]]]></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/2010/03/graphics-tech-lighting-comparison/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Shadow Maps (part 1)</title>
		<link>http://the-witness.net/news/2010/03/graphics-tech-shadow-maps-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-shadow-maps-part-1</link>
		<comments>http://the-witness.net/news/2010/03/graphics-tech-shadow-maps-part-1/#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/2010/03/graphics-tech-shadow-maps-part-1/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Announcing Indie Fund</title>
		<link>http://the-witness.net/news/2010/03/announcing-indie-fund/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=announcing-indie-fund</link>
		<comments>http://the-witness.net/news/2010/03/announcing-indie-fund/#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 [...]]]></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/2010/03/announcing-indie-fund/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Twitter and Facebook pages are now live.</title>
		<link>http://the-witness.net/news/2010/03/twitter-and-facebook-pages-are-now-live/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-and-facebook-pages-are-now-live</link>
		<comments>http://the-witness.net/news/2010/03/twitter-and-facebook-pages-are-now-live/#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/2010/03/twitter-and-facebook-pages-are-now-live/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Graphics Tech: Precomputed Lighting</title>
		<link>http://the-witness.net/news/2010/03/graphics-tech-precomputed-lighting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=graphics-tech-precomputed-lighting</link>
		<comments>http://the-witness.net/news/2010/03/graphics-tech-precomputed-lighting/#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/2010/03/graphics-tech-precomputed-lighting/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Concept Art</title>
		<link>http://the-witness.net/news/2010/02/concept-art/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=concept-art</link>
		<comments>http://the-witness.net/news/2010/02/concept-art/#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 [...]]]></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">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://the-witness.net/news/2010/02/concept-art/?show=slide">
			[Show as slideshow]		</a>
	</div>

	
	<!-- 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/2010/02/concept-art/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Welcome to the development blog for The Witness.</title>
		<link>http://the-witness.net/news/2010/02/welcome-to-the-development-blog-for-the-witness/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=welcome-to-the-development-blog-for-the-witness</link>
		<comments>http://the-witness.net/news/2010/02/welcome-to-the-development-blog-for-the-witness/#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 [...]]]></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/2010/02/welcome-to-the-development-blog-for-the-witness/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

