Build

From ZDoom Wiki
Jump to: navigation, search

MiniWikipediaLogoIcon.pngBuild is an engine developed by Ken Silverman for Apogee Software/3D Realms. ZDoom borrows a few elements from Build for various purposes.

Here's a summary of the Build code in ZDoom that I wrote a few months ago:

The slopes themselves were (and still are) entirely my own code. The part that's from Build is the wall boundary calculations. The way Doom did it was too imprecise for any useful sloping, so I was in the process of rewriting it to use the standard perspective divide equations, then Build's source was released, and I saw I was going in the same direction as it, so I just used its code to save myself some time. Here's a list of Build-touched functions:

  • R_AddLine everything before backsector = line->backsector (note: This has been completely refactored since this article was written.)
  • R_RenderDecal uses the same projection code as R_AddLine. It's just standard perspective divide stuff. (note: Code has been merged with the refactored version from R_AddLine)
  • wallscan/maskwallscan/transmaskwallscan multicolumn rasterizers straight from Build (note: removed in 60ae4a8)
  • OWallMost/WallMost calculate top and bottom edges of walls, also straight from build (note: removed in 547973c)
  • PrepWall/PrepLWall calculate texture coordinates and scales along a wall, for use with wallscan (note: these functions had already eliminated the vast majority of Build code long ago, but 6417c1a7 rewrites the remaining part entirely so there's nothing left anymore)
  • a.asm everything in here (note: removed in a118903)

There might be others, but I'm pretty sure that's all of it. The wallscan and prepwall routines are basically all for splitting up R_RenderSegLoop so that it can draw four columns at a time instead of just one, which can be significantly faster depending on the processor's cache. You could remove those and go back to the old R_RenderSegLoop without affecting slopes, but there will be a performance hit.

In addition, voxels are also rendered with Build code. (The code to load a voxel object in memory, though, is custom.)

See also