Brush (video games)

Last updated

Brushes are templates used in some 3D video game engines, such as the Quake engine, its derivatives the GoldSrc and Source game engines, or the Unreal Engine, to construct levels. [1] Brushes can be primitive shapes (such as cubes, spheres and cones), pre-defined shapes (such as staircases), or custom shapes (such as prisms and other polyhedra). [2] [3] In order to describe these shapes mathematically, each brush is made up of planes that define its boundaries. A plane can be represented by an equation in 3D space, which looks like this:

Contents

This equation describes a single flat surface (or plane) in 3D space, where a, b, and c are coefficients that determine the orientation of the plane, and d is a constant that shifts the plane along its axis.

To construct a brush, the game engine uses multiple planes working together. For example, a cube can be defined by six planes, each restricting space within a certain region. Here’s how a set of three planes would be represented mathematically:

Each of these equations corresponds to a different plane that helps define the shape of the brush.

In some engines such as Unreal, brushes are categorized as either additive or subtractive. Additive brushes add volume to the level, forming walls, platforms, or other structures, while subtractive brushes carve out spaces within these volumes, like windows or doorways. [4]

During the map compilation process, brushes are turned into meshes that can be rendered by the game engine. Often brushes are restricted to convex shapes only, as this reduces the complexity of the binary space partitioning process. However, using CSG operations, complex rooms and objects can be created by adding, subtracting and intersecting brushes to and from one another. [5] Additionally, brushes can be used as liquids [6] or as an area trigger. [7]

History

Brush-based techniques originated during the period of three-dimensional game development, being developed around the same time period as Quake. These games required 3D geometry for constructing more advanced true 3D environments different from previous raycasting approaches. During this time brushes became used with and closely associated with Binary Space Partitioning as this allowed for sustaining real-time performance on constrained computational hardware. Brushes offered a viable solution, enabling level designers to utilize elementary geometric primitives for the creation of intricate spatial structures. [8] [9]

Modern use

Brush-based modeling is extensively used in constructive solid geometry, a technique that builds complex surfaces by combining simpler ones using Boolean operations such as union, intersection, and difference. [10] In modern game engines, brushes are usually limited to only being used during the initial prototyping or "Block out" phase. This is due to the fact that they are less efficient when overused, slowing down performance due to their simple, non-optimized geometry. [11]

Related Research Articles

In mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry using a coordinate system. This contrasts with synthetic geometry.

<span class="mw-page-title-main">Cartesian coordinate system</span> Most common coordinate system (geometry)

In geometry, a Cartesian coordinate system in a plane is a coordinate system that specifies each point uniquely by a pair of real numbers called coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, called coordinate lines, coordinate axes or just axes of the system. The point where the axes meet is called the origin and has (0, 0) as coordinates. The axes directions represent an orthogonal basis. The combination of origin and basis forms a Cartesian frame.

In mathematics, an equation is a mathematical formula that expresses the equality of two expressions, by connecting them with the equals sign =. The word equation and its cognates in other languages may have subtly different meanings; for example, in French an équation is defined as containing one or more variables, while in English, any well-formed formula consisting of two expressions related with an equals sign is an equation.

<span class="mw-page-title-main">Sphere</span> Set of points equidistant from a center

A sphere is a geometrical object that is a three-dimensional analogue to a two-dimensional circle. Formally, a sphere is the set of points that are all at the same distance r from a given point in three-dimensional space. That given point is the center of the sphere, and r is the sphere's radius. The earliest known mentions of spheres appear in the work of the ancient Greek mathematicians.

<span class="mw-page-title-main">Binary space partitioning</span> Method for recursively subdividing a space into two subsets using hyperplanes

In computer science, binary space partitioning (BSP) is a method for space partitioning which recursively subdivides a Euclidean space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a representation of objects within the space in the form of a tree data structure known as a BSP tree.

<span class="mw-page-title-main">Euclidean planes in three-dimensional space</span> Flat surface

In Euclidean geometry, a plane is a flat two-dimensional surface that extends indefinitely. Euclidean planes often arise as subspaces of three-dimensional space . A prototypical example is one of a room's walls, infinitely extended and assumed infinitesimal thin. While a pair of real numbers suffices to describe points on a plane, the relationship with out-of-plane points requires special consideration for their embedding in the ambient space .

<span class="mw-page-title-main">Normal (geometry)</span> Line or vector perpendicular to a curve or a surface

In geometry, a normal is an object that is perpendicular to a given object. For example, the normal line to a plane curve at a given point is the line perpendicular to the tangent line to the curve at the point.

<span class="mw-page-title-main">Homogeneous coordinates</span> Coordinate system used in projective geometry

In mathematics, homogeneous coordinates or projective coordinates, introduced by August Ferdinand Möbius in his 1827 work Der barycentrische Calcul, are a system of coordinates used in projective geometry, just as Cartesian coordinates are used in Euclidean geometry. They have the advantage that the coordinates of points, including points at infinity, can be represented using finite coordinates. Formulas involving homogeneous coordinates are often simpler and more symmetric than their Cartesian counterparts. Homogeneous coordinates have a range of applications, including computer graphics and 3D computer vision, where they allow affine transformations and, in general, projective transformations to be easily represented by a matrix. They are also used in fundamental elliptic curve cryptography algorithms.

<span class="mw-page-title-main">Algebraic curve</span> Curve defined as zeros of polynomials

In mathematics, an affine algebraic plane curve is the zero set of a polynomial in two variables. A projective algebraic plane curve is the zero set in a projective plane of a homogeneous polynomial in three variables. An affine algebraic plane curve can be completed in a projective algebraic plane curve by homogenizing its defining polynomial. Conversely, a projective algebraic plane curve of homogeneous equation h(x, y, t) = 0 can be restricted to the affine algebraic plane curve of equation h(x, y, 1) = 0. These two operations are each inverse to the other; therefore, the phrase algebraic plane curve is often used without specifying explicitly whether it is the affine or the projective case that is considered.

<span class="mw-page-title-main">3D projection</span> Design technique

A 3D projection is a design technique used to display a three-dimensional (3D) object on a two-dimensional (2D) surface. These projections rely on visual perspective and aspect analysis to project a complex object for viewing capability on a simpler plane.

<span class="mw-page-title-main">Vanishing point</span> Artistic concept relating to perspective

A vanishing point is a point on the image plane of a perspective rendering where the two-dimensional perspective projections of mutually parallel lines in three-dimensional space appear to converge. When the set of parallel lines is perpendicular to a picture plane, the construction is known as one-point perspective, and their vanishing point corresponds to the oculus, or "eye point", from which the image should be viewed for correct perspective geometry. Traditional linear drawings use objects with one to three sets of parallels, defining one to three vanishing points.

<span class="mw-page-title-main">Line (geometry)</span> Straight figure with zero width and depth

In geometry, a straight line, usually abbreviated line, is an infinitely long object with no width, depth, or curvature, an idealization of such physical objects as a straightedge, a taut string, or a ray of light. Lines are spaces of dimension one, which may be embedded in spaces of dimension two, three, or higher. The word line may also refer, in everyday life, to a line segment, which is a part of a line delimited by two points.

A first-person shooter engine is a video game engine specialized for simulating 3D environments for use in a first-person shooter video game. First-person refers to the view where the players see the world from the eyes of their characters. Shooter refers to games which revolve primarily around wielding firearms and killing other entities in the game world, either non-player characters or other players.

<span class="mw-page-title-main">Quake Army Knife</span> 3D asset developing program

Quake Army Knife (QuArK), is a free and open-source program for developing 3D assets for a large variety of first-person shooters, such as video games using the Quake engine by id Software or the Torque engine.

<span class="mw-page-title-main">3D GameStudio</span>

3D GameStudio or 3DGS is a pan 3D computer game development system which allows the users to create 3D games and other virtual reality applications, and publish them royalty-free. It includes a model/terrain editor, a level editor, a script editor/debugger and comes with a big collection of textures, models and artwork, as well as a game template system that allows the creation of basic shooter games or RPGs without programming. For complex games or other applications, either the integrated programming language named Lite-C or an external development language such as Visual C++ or Borland Delphi can be used.

<span class="mw-page-title-main">Three-dimensional space</span> Geometric model of the physical space

In geometry, a three-dimensional space is a mathematical space in which three values (coordinates) are required to determine the position of a point. Most commonly, it is the three-dimensional Euclidean space, that is, the Euclidean space of dimension three, which models physical space. More general three-dimensional spaces are called 3-manifolds. The term may also refer colloquially to a subset of space, a three-dimensional region, a solid figure.

<span class="mw-page-title-main">Differential geometry of surfaces</span> The mathematics of smooth surfaces

In mathematics, the differential geometry of surfaces deals with the differential geometry of smooth surfaces with various additional structures, most often, a Riemannian metric.

<span class="mw-page-title-main">Pole and polar</span> Unique point and line of a conic section

In geometry, a pole and polar are respectively a point and a line that have a unique reciprocal relationship with respect to a given conic section.

In Euclidean and projective geometry, five points determine a conic, just as two (distinct) points determine a line. There are additional subtleties for conics that do not exist for lines, and thus the statement and its proof for conics are both more technical than for lines.

<span class="mw-page-title-main">Intersection (geometry)</span> Shape formed from points common to other shapes

In geometry, an intersection is a point, line, or curve common to two or more objects. The simplest case in Euclidean geometry is the line–line intersection between two distinct lines, which either is one point or does not exist. Other types of geometric intersection include:

References

  1. "Definition of Brush in the Valve Developer Community". Valve. Retrieved 2011-03-24.
  2. Finney, Kenneth V. (2004). 3D Game Programming All in One (Course Technology PTR Game Development Series). Muska & Lipman/Premier-Trade. ISBN   1-59200-136-X.
  3. Holmes, Shawn (2002). Focus on Mod Programming for Quake III Arena. Premier Press. ISBN   1-931841-56-X.
  4. "Mastering the Basics of Unreal Engine 4: BSP Geometry". www.pluralsight.com. Retrieved 2024-10-03.
  5. "UDN – Two – BspBrushesTutorial". Epic Games . Retrieved 2012-04-21.
  6. BSP Headquarters - BSP Quake Tutorial #5
  7. BSP Headquarters - BSP Quake Tutorial #6
  8. Kushner, David S.; Kushner, David (2003). Masters of doom: how two guys created an empire and transformed pop culture (1st ed.). New York: Random House. ISBN   978-0-375-50524-9.
  9. Kremers, Rudolf (2009). Level design: concept, theory, and practice. Wellesley, MA: A.K. Peters. ISBN   978-1-56881-338-7.
  10. Hughes, John F. (2014). Computer graphics: principles and practice (3rd ed.). Upper Saddle River, New Jersey: Addison-Wesley. ISBN   978-0-321-39952-6.
  11. "Mastering the Basics of Unreal Engine 4: BSP Geometry". www.pluralsight.com. Retrieved 2024-10-03.