Remove colour attributes from body and strip most of the font tags out

This commit is contained in:
James Gregory 2013-12-30 13:57:02 +11:00
commit c1f88ddb41
362 changed files with 1632 additions and 1706 deletions

View file

@ -24,7 +24,7 @@
<!--CHAPTER=70//-->
<!--PAGES=1279-1281//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -36,12 +36,12 @@
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading4"></A><FONT COLOR="#000077">Passages: The Last-Minute Change that Didn&rsquo;t Happen</FONT></H3>
<H3><A NAME="Heading4"></A>Passages: The Last-Minute Change that Didn&rsquo;t Happen</H3>
<P>Earlier, I mentioned that we almost changed 3-D engines again in the last month of Quake&rsquo;s development. Here&rsquo;s what happened: One of the alternatives to the PVS is the use of <I>portals</I>, where the focus is on the places where polygons don&rsquo;t exist along leaf faces, rather than the more usual focus on the polygons themselves. These &ldquo;empty&rdquo; places are themselves polygons, called portals, that describe all the places that visibility can pass from one leaf to another. Portals are used by the PVS generator to determine visibility, and are used in other 3-D engines as the primary mechanism for determining leaf or sector visibility. For example, portals can be projected to screenspace, then used as a 2-D clipping region to restrict drawing of more distant polygons to only those that are visible through the portal. Or, as in Quake&rsquo;s preprocessor, visibility boundary planes can be constructed from one portal to the next, and 3-D clipping to those planes can be used to determine visible polygons or leaves. Used either way, portals can support more changeable worlds than the PVS, because, unlike the PVS, the portals themselves can easily be changed on the fly.</P>
<P>The problem with portal-based visibility is that it tends to perform at its worst in complex scenes, which can have many, many portals. Since those are the most expensive scenes to draw, as well, portals tend to worsen the worst case. However, late in Quake&rsquo;s development, John realized that the approach of storing portals themselves in the world database could readily be improved upon. (To be clear, Quake wasn&rsquo;t using portals at that point, and didn&rsquo;t end up using them.) Since the aforementioned sets of 3-D visibility clipping planes <I>between</I> portals&mdash;which he named <I>passages</I>&mdash;were what actually got used for visibility, if he stored those, instead of generating them dynamically from the portals, he would be able to do visibility much faster than with standard portals. This would give a significantly tighter polygon set than the PVS, because it would be based on visibility through the passages from the viewpoint, rather than the PVS&rsquo;s approach of visibility from anywhere in the leaf, and that would be a considerable help, because the level designers were running right up against performance limits, partly because of the PVS&rsquo;s relatively loose polygon set. John immediately decided that passages-based visibility was a sufficiently superior approach that if it worked out, he would switch Quake to it, even at that late stage, and within a weekend, he had implemented it and had it working&mdash;only to find that, like portals, it improved best cases but worsened worst cases, and overall wasn&rsquo;t a win for Quake. In truth, given how close we were to shipping, John was as much thankful as disappointed that passages didn&rsquo;t work out, but the possibilities were too great for us not to have taken a shot at it.</P>
<P>So why even bother mentioning this? Partly to show that not every interesting idea pans out; I tend to discuss those that <I>did</I> pan out, and it&rsquo;s instructive to point out that many ideas don&rsquo;t. That doesn&rsquo;t mean you shouldn&rsquo;t try promising ideas, though. First, some do pan out, and you&rsquo;ll never know which unless you try. Second, an idea that doesn&rsquo;t work out in one case can still be filed away for another case. It&rsquo;s quite likely that passages will be useful in a different context in a future engine.</P>
<P>The more approaches you try, the larger your toolkit and the broader your understanding will be when you tackle your next project.</P>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">Drawing the World</FONT></H3>
<H3><A NAME="Heading5"></A>Drawing the World</H3>
<P>Everything described so far is a preprocessing step. When Quake is actually running, the world is drawn as follows: First, the PVS for the view leaf is decompressed, and each leaf flagged as visible is marked as being in the current frame&rsquo;s PVS. (The marking is done by storing the current frame&rsquo;s number in the leaf; this avoids having to clear the PVS marking each frame.) All the parent nodes of each leaf in the PVS are also marked; this information could have been stored as additional PVS flags, but to save space is bubbled up the BSP from each visible leaf.
</P>
<P>After the PVS is marked, the BSP is walked front-to-back. At each node, the bounding box of the node&rsquo;s subspace is clipped against the view frustum; if the bounding box is fully clipped, then that node and all its children are ignored. Likewise, if the node is not in the PVS for the current viewpoint leaf, the node and all its children are ignored. If the bounding box is partially clipped or not clipped at all, that information is passed to the children so that any unnecessary clip tests can be avoided. The children in front of the node are then processed recursively. When a leaf is reached, polygons that touch that leaf are marked as potentially drawable. When recursion in front of a node is finished, all polygons on the front side of the node that are marked as potentially drawable are added to the edge list, and then the children on the back side of that node are similarly processed recursively.</P>
@ -62,7 +62,7 @@
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book &copy; 2001 Michael Abrash</font>
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->