Permalink
Browse files

Second draft of Architecture chapter.

  • Loading branch information...
1 parent 8faea03 commit 911cb7606937d890c774d5503cb712b22bf1b08b @munificent committed Apr 16, 2014
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / {{title}}</title>
+<title>{{title}} &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
Oops, something went wrong.
@@ -66,7 +66,7 @@ This is all well and good for storing stuff in main memory, but that doesn't hel
## A Thousand Instances
-To minimize the amount of data we have to push to the GPU, we want to be able to send the shared data -- the `TreeModel` -- just *once*. Then, separately, we push over every tree instance's unique data -- its position, color, and scale. Then we tell the GPU, "use that one model to render each of these instances".
+To minimize the amount of data we have to push to the GPU, we want to be able to send the shared data -- the `TreeModel` -- just *once*. Then, separately, we push over every tree instance's unique data -- its position, color, and scale. Then we tell the GPU, "use that one model to render each of these instances."
Fortunately, today's graphics APIs and <span name="hardware">cards</span> support exactly that. The details are fiddly, and out of the scope of this book, but both Direct3D and OpenGL have support for [*instanced rendering*](http://en.wikipedia.org/wiki/Geometry_instancing).
@@ -274,7 +274,7 @@ in the larger pattern ecosystem.
## How the Book is Formatted
Each <span name="aside">pattern</span> has a set of parts -- the ingredients in its recipe.
-Every implementation will include these parts, so its important to
+Every implementation will include these parts, so it's important to
note them all. The first time one is mentioned, it will be in **bold
face**.
Oops, something went wrong.
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Behavioral Patterns</title>
+<title>Behavioral Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Behavioral Patterns / Bytecode</title>
+<title>Bytecode &middot; Behavioral Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / Command</title>
+<title>Command &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Decoupling Patterns / Component</title>
+<title>Component &middot; Decoupling Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Optimization Patterns / Data Locality</title>
+<title>Data Locality &middot; Optimization Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Decoupling Patterns</title>
+<title>Decoupling Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited</title>
+<title>Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Optimization Patterns / Dirty Flag</title>
+<title>Dirty Flag &middot; Optimization Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Sequencing Patterns / Double Buffer</title>
+<title>Double Buffer &middot; Sequencing Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Decoupling Patterns / Event Queue</title>
+<title>Event Queue &middot; Decoupling Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / Flyweight</title>
+<title>Flyweight &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -177,7 +177,7 @@ <h1 class="book"><a href="index.html">Game Programming Patterns</a><span class="
<p>This is all well and good for storing stuff in main memory, but that doesn&#x2019;t help rendering. Before the forest gets on screen, it has to work its way over to the GPU&#x2019;s memory. We need to express this resource sharing in a way that the graphics card understands.</p>
<h2><a href="#a-thousand-instances" name="a-thousand-instances">A Thousand Instances</a></h2>
-<p>To minimize the amount of data we have to push to the GPU, we want to be able to send the shared data&thinsp;&mdash;&thinsp;the <code>TreeModel</code>&thinsp;&mdash;&thinsp;just <em>once</em>. Then, separately, we push over every tree instance&#x2019;s unique data&thinsp;&mdash;&thinsp;its position, color, and scale. Then we tell the GPU, "use that one model to render each of these instances".</p>
+<p>To minimize the amount of data we have to push to the GPU, we want to be able to send the shared data&thinsp;&mdash;&thinsp;the <code>TreeModel</code>&thinsp;&mdash;&thinsp;just <em>once</em>. Then, separately, we push over every tree instance&#x2019;s unique data&thinsp;&mdash;&thinsp;its position, color, and scale. Then we tell the GPU, "use that one model to render each of these instances."</p>
<p>Fortunately, today&#x2019;s graphics APIs and <span name="hardware">cards</span> support exactly that. The details are fiddly, and out of the scope of this book, but both Direct3D and OpenGL have support for <a href="http://en.wikipedia.org/wiki/Geometry_instancing"><em>instanced rendering</em></a>.</p>
<p>In both APIs, you provide two streams of data. The first is the blob of common data that will be rendered multiple times&thinsp;&mdash;&thinsp;the mesh and textures in our arboreal example. The second is the list of instances and their parameters that will be used to vary that first chunk of data each time it&#x2019;s drawn. With a single draw call, an entire forest appears.</p>
<aside name="hardware">
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Sequencing Patterns / Game Loop</title>
+<title>Game Loop &middot; Sequencing Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Introduction</title>
+<title>Introduction &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -340,7 +340,7 @@ <h1 class="book"><a href="index.html">Game Programming Patterns</a></h1>
in the larger pattern ecosystem.</p>
<h2><a href="#how-the-book-is-formatted" name="how-the-book-is-formatted">How the Book is Formatted</a></h2>
<p>Each <span name="aside">pattern</span> has a set of parts&thinsp;&mdash;&thinsp;the ingredients in its recipe.
-Every implementation will include these parts, so its important to
+Every implementation will include these parts, so it&#x2019;s important to
note them all. The first time one is mentioned, it will be in <strong>bold
face</strong>.</p>
<aside name="aside">
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Optimization Patterns / Object Pool</title>
+<title>Object Pool &middot; Optimization Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / Observer</title>
+<title>Observer &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Optimization Patterns</title>
+<title>Optimization Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / Prototype</title>
+<title>Prototype &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Sequencing Patterns</title>
+<title>Sequencing Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Decoupling Patterns / Service Locator</title>
+<title>Service Locator &middot; Decoupling Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / Singleton</title>
+<title>Singleton &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Optimization Patterns / Spatial Partition</title>
+<title>Spatial Partition &middot; Optimization Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Design Patterns Revisited / State</title>
+<title>State &middot; Design Patterns Revisited &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Behavioral Patterns / Subclass Sandbox</title>
+<title>Subclass Sandbox &middot; Behavioral Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Behavioral Patterns / Type Object</title>
+<title>Type Object &middot; Behavioral Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
-<title>Game Programming Patterns / Sequencing Patterns / Update Method</title>
+<title>Update Method &middot; Sequencing Patterns &middot; Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
View
@@ -1,3 +1,8 @@
+2014-04-15 - email lb
+2014-04-14 - 481 words, finish second draft
+2014-04-13 - 967 words, second draft, email possible proofreader
+2014-04-12 - 1194 words, second draft
+2014-04-11 - 978 words, second draft
2014-04-10 - 883 words, finish first draft arch
2014-04-09 - 1348 words, arch
2014-04-08 - 265 words, first draft arch
View
@@ -147,7 +147,7 @@ def formatfile(path, nav, skip_up_to_date):
section_header = ""
if section != "":
- title_text = section + " / " + title
+ title_text = title + " &middot; " + section
section_href = section.lower().replace(" ", "-")
section_header = '<span class="section"><a href="{}.html">{}</a></span>'.format(
section_href, section)

0 comments on commit 911cb76

Please sign in to comment.