Brush

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
m
m (Shape)
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{unfinished}}
+
{{finished}}
 
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]
 
[[File:Radiant brush.jpg|320px|right|thumb|Brush of the crypt entrance in NetRadiant]]
  
Basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term brush is used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[path mesh|patch meshes]]. A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc) depending on the textures and materials applied to them.  
+
A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term "brush" originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses [[patch mesh|patch meshes]] (which is different from CSG brush in both construction and texturing).
  
Brush is [[CSG | consecutive solid geometry]]. It defines a form made of it's sides and a volume which is anyting inside. Brush is using this rules:
+
A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them.  
  
* Minimum 3 sides
+
Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.
 +
 
 +
One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.
 +
 
 +
== Shape ==
 +
 
 +
Properly constructed brush follows this rules:
 +
 
 +
* Has at least 3 sides
 
* Each side is plane forming polyhedron (maximum 16-24 corners)
 
* Each side is plane forming polyhedron (maximum 16-24 corners)
* If slice brush by the plane of any of it's sides, whole brush will be on one side of the plane
+
* If sliced by the plane of any of its sides, the whole brush will be on one side of the plane
  
=== Texture projection ===
+
{{Important|Radiant have tools to edit brush shape (vertexes, sides and planes) that are not CSG-friendly. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid. CSG operations ([[Radiant/CSG Substract|substract]], [[Radiant/CSG Make hollow|hollow]] and [[Radiant/Clipper|clipper]]) always make valid brush.}}
 +
 +
[[File:Brush rules.jpg|750px]]
  
Since brush internal structure dont have vertices, it is using special projection technique to get texture mapping:
+
== Texturing ==
  
# Texture get projected from axis planes (XY, XZ, YZ) to a sides of the brush, optimal projection plane is selected by brush side orientation.
+
Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:
 +
 
 +
# Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
 
# Texture is rotated by plane's ''rotate'' parameter.
 
# Texture is rotated by plane's ''rotate'' parameter.
 
# Texture position is scaled by plane's ''stretch'' (x and y).
 
# Texture position is scaled by plane's ''stretch'' (x and y).
 
# Texture position is shifted by plane's ''offset'' (x and y).
 
# Texture position is shifted by plane's ''offset'' (x and y).
# Using texture dimensions, positions is converted to texture coordinates.
+
# When using texture dimensions, positions are converted to texture coordinates.
  
 
This leads to a number of limitations applied for brushes:
 
This leads to a number of limitations applied for brushes:
  
* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation work fine)
+
* Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
* Texturing may broke if texture resolution is changed (there is material trick to bypass that)
+
* Texturing may break if texture resolution is changed (there is a material trick to bypass that).
  
 
Along with limitations, there is a number of benefits:
 
Along with limitations, there is a number of benefits:
  
* No texture coords = no UVW unwrap work.
+
* No texture coordinates = no UVW unwrap work.
 
* A little easier to control [[texture detail]].
 
* A little easier to control [[texture detail]].
 
* No texture UV breakage when model is sliced/expanded.
 
* No texture UV breakage when model is sliced/expanded.
 
* Can scale model with keeping original texture detail.
 
* Can scale model with keeping original texture detail.
* Can modify brush in various ways with no texture breakage (make wall longer for example).
+
* Can modify brush in various ways with no texture breakage (make a wall longer for example).
  
== Brush volume ==
+
== Volume ==
  
=== 1. Brush contents ===
+
==== Brush contents ====
  
Physics-related contents of the brush. Could be one of the followed:
+
Physics-related contents of the brush. Could be one of the following:
  
 
* Solid
 
* Solid
Line 46: Line 58:
 
* Sky
 
* Sky
  
Brush contents are defined from the materials brush have on it's sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).
+
Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).
  
=== 2. Brush VIS transparency ===
+
==== VIS transparency ====
  
 
This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.
 
This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.
Line 54: Line 66:
 
Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.
 
Detail brushes (Radiant feature) and [[BModel | bmodels]] are always 'transparent'.
  
Also if brush have sides which is marked detailed or transparent, it will be forced transparent.
+
Also if a brush have sides marked detailed or transparent, it will be forced transparent.
 +
 
 +
== Brush vs Patch mesh vs Triangle model ==
 +
 
 +
Brushes are essential when making:
 +
* Geometry that requires a volume to function properly (water, triggers).
 +
* Level hull structure (the geometry that forms [[VIS]] portal tree).
 +
* Geometry used to connect rooms together.
 +
 
 +
Brushes are good when making:
 +
* Simple detail objects used to cover corners and connect parts of level together.
 +
* Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls.
 +
* Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).
 +
 
 +
For all other cases, [[patch mesh|patch meshes]] and triangle models are better and easier alternative to work with.
 +
 
 +
Some examples of good and bad usage of brushes:
 +
 
 +
{| cellspacing=0 cellpadding=2 border=1 style="width:100%;border-collapse:collapse"
 +
| width=10% | Room floors
 +
| width=10% | <font color=green>Good choice</font>
 +
| width=80% | Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
 +
|-
 +
| Walls
 +
| <font color=green>Good choice</font>
 +
| Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls.
 +
|-
 +
| Statue
 +
| <font color=red>Not a good choice</font>
 +
| Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
 +
|-
 +
| Chair
 +
| <font color=red>Not a good choice</font>
 +
| Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
 +
|-
 +
| Terrain
 +
| <font color=orange>May be good choice</font>
 +
| Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
 +
|-
 +
| House
 +
| <font color=orange>May be good choice</font>
 +
| Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.
 +
|}
  
 
== See also ==
 
== See also ==
* [[Radiant Glossary]]
+
* [[Radiant/Glossary|Radiant glossary]]
 
* [[BModel]]
 
* [[BModel]]
 
* [[BSP]]
 
* [[BSP]]
  
 
[[Category:Glossary]]
 
[[Category:Glossary]]
 +
{{grammar checked|darth}}
 
__NOTOC__
 
__NOTOC__

Latest revision as of 14:45, 10 October 2012

Brush of the crypt entrance in NetRadiant

A brush is a basic building block in a level. It is used primarily to define the physical structure of the area being designed. The term "brush" originally was used by Radiant to refer to anything that is not an entity, and therefore also encompasses patch meshes (which is different from CSG brush in both construction and texturing).

A brush can be made to represent anything from solid matter (metal, dirt, wood, etc.) to liquids (lava, water, etc.) depending on the textures and materials applied to them.

Brush is constructive solid geometry (CSG) primitive and convex figure. It uses a form made of its sides and a volume which is anyting inside. Brushes are presented in Unreal Engine (1/2/3), Torgue engine, Cryengine 3. Hammer (native editor for Source engine games) is using it too. CSG is popular because a modeler can use a set of relatively simple objects to create very complicated geometry. User can revise their complex geometry by changing the position of objects or by changing brush attributes.

One way to think about level making with brushes is like you are building your structures out of somewhat flexible lego blocks.

[edit] Shape

Properly constructed brush follows this rules:

  • Has at least 3 sides
  • Each side is plane forming polyhedron (maximum 16-24 corners)
  • If sliced by the plane of any of its sides, the whole brush will be on one side of the plane
Important: Radiant have tools to edit brush shape (vertexes, sides and planes) that are not CSG-friendly. If you apply transformation that will lead to non-convex figure, resulting brush will be invalid. CSG operations (substract, hollow and clipper) always make valid brush.

Brush rules.jpg

[edit] Texturing

Since brush internal structure doesn't have vertices, it is using special projection technique to get texture mapping:

  1. Texture gets projected from axis planes (XY, XZ, YZ) to the sides of the brush, optimal projection plane is selected by brush side orientation.
  2. Texture is rotated by plane's rotate parameter.
  3. Texture position is scaled by plane's stretch (x and y).
  4. Texture position is shifted by plane's offset (x and y).
  5. When using texture dimensions, positions are converted to texture coordinates.

This leads to a number of limitations applied for brushes:

  • Rotating texture is tricky as no rotation origin is specified, this leads to texture breakage when brush is rotated to small angles (90 degrees rotation works fine).
  • Texturing may break if texture resolution is changed (there is a material trick to bypass that).

Along with limitations, there is a number of benefits:

  • No texture coordinates = no UVW unwrap work.
  • A little easier to control texture detail.
  • No texture UV breakage when model is sliced/expanded.
  • Can scale model with keeping original texture detail.
  • Can modify brush in various ways with no texture breakage (make a wall longer for example).

[edit] Volume

[edit] Brush contents

Physics-related contents of the brush. Could be one of the following:

  • Solid
  • Non-solid
  • Water
  • Slime
  • Lava
  • Sky

Brush contents are defined from the materials brush has on its sides. Usually all brush sides must have same contents (mixed contents will give a compiler warning and could lead to bugged behavior).

[edit] VIS transparency

This is not real transparency but any brush that does not provide structure/seal to a room, and merely is there to detail the room.

Detail brushes (Radiant feature) and bmodels are always 'transparent'.

Also if a brush have sides marked detailed or transparent, it will be forced transparent.

[edit] Brush vs Patch mesh vs Triangle model

Brushes are essential when making:

  • Geometry that requires a volume to function properly (water, triggers).
  • Level hull structure (the geometry that forms VIS portal tree).
  • Geometry used to connect rooms together.

Brushes are good when making:

  • Simple detail objects used to cover corners and connect parts of level together.
  • Semi-complex objects, which are derived version of some generic object (think house or other building) but with altered proportions/moved walls.
  • Geometry that is more convenient to make with brushes (using it's features - CSG operators, projection texturing and ability to be edited in level editor).

For all other cases, patch meshes and triangle models are better and easier alternative to work with.

Some examples of good and bad usage of brushes:

Room floors Good choice Most of room floors are part of world hull. It is useful to edit them inside radiant. For physics floors have priority because gravity always make object to fall, so high mathematical precision of brushes will help with making physics more stable.
Walls Good choice Same as for the floor. Walls are part of map hull and when working with map, you ofter reconfigure your walls.
Statue Not a good choice Since complex models are broken into many brushes, it is hard to control texturing on them. Also texture projection is only capable of making simple UV. So you statue will be either crude or take insane amount of time to build with brushes.
Chair Not a good choice Same as for statue. Chair is too complex for brushes. It is easier to make it with misc_gamemodel.
Terrain May be good choice Small chunks of terrain are good to make with brushes, as they can be reconfigured in editor and don't require working with exporting/importing as for models. Brushes are also part of the .map file, so they don't generate any external files. Vertex alpha should be handled by colormod brushes. The big landscapes are not good to make with brushes, because big terrain takes 5000+ brushes and per-brush works is quite ineffective for it.
House May be good choice Since brush have projection texturing, its easy to move house walls/alter its height without texture breakage, which may be easy way to make villages. But house is a complex object, and making it with brushes may get hard and ineffective, depending on house design. So it's up to designer whether use brushes or triangle models for buildings.

[edit] See also

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox