Brushes
Hierarchy
BaseBrushScript
BlocksBrushScript
purely exists to provide a vertex layout.EnvironmentBrushScript
purely exists to provide a vertex layout.PbrBrushScript
purely exists to provide a vertex layout.GeometryBrush
FlatGeometryBrush
HullBrush
MidpointPlusLifetimeSprayBrush
GeniusParticlesBrush
- camera aligned particles. Particle brush V2.PrintableBrush
SliceBrush
gives each control point a quad whose normal is the direction of motion.SprayBrush
Square3DPrintBrush
generates a manifold, 3D printable "tube" with a roundedsquare cross section.
SquareBrush
TetraBrush
ThickGeometryBrush
TubeBrush
BubbleWandBrush
QuadStripBrush
- base class of brushes that draw flat ribbons of connected quads.This is the first brush that existed.
QuadStripBrushDistanceUV
QuadStripBrushStretchUV
QuadStripUnitizedUVBrush
ParentBrush
CandyCane
HolidayTree
PlaitBrush
SnowflakeBrush
illustrates 6-fold symmetry.
MasterBrush
holds geometry in progress. It's used for both active stroke and thepreview stroke, and handles decay of preview brush for certain brush types. Typical
use would push the geometry here down to the Unity mesh every frame.
ActiveStroke
would be a better name.
History
From notes by Paul Du Bois:
Things started with QuadStripBrush
, with a couple variants based on how UVs were generated. It just generates strips, 6 unique verts per tri (3 for top, 3 for bottom, backface culled). Then there was a variant that produced isolated quads (for brushes like "leaves") instead of strips. QuadStripBrush
uses a class called MasterBrush
to temporarily store and work on the geometry before it's finalized into a mesh / batch.
Then GeometryBrush
to "reboot" geometry generation and enable other kinds of topology. The intent was that QuadStripBrush
-based brushes would migrate to FlatGeometryBrush
, but the way that QuadStripBrush
did its smoothing was not easy to replicate (the details aren't important but the incremental algorithm QSB uses means that each knot doesn't have "local support" in the technical sense, and GeometryBrush
in part was written to force people to use knots with local or at least bounded support for efficiency reasons). So FlatGeometryBrush
isn't used much. Most other brushes are derived from GeometryBrush
.
GeometryBrush
is notable for using a different storage scheme for intermediate geometry called "GeometryPool
". This is used all over the place, wherever we want to process mesh data in C# (eg: geometry generation, multiplying geometry by a TrTransform
, export). Some of these manipulations have native-code versions that MachWerx wrote in C++; I think we ship that DLL in the repo.
The GeometryBrush
variant of the old "isolated quad" brushes is SprayBrush
, and I think the old version of that doesn't exist in the code any more.
GeniusParticlesBrush
is I think Xap's very first work on the project and replaced an older less genius way of particle brushes.
TubeBrush
was our first volumetric brush; it's also slightly notable for using a different method of curve framing. Instead of BaseBrushScript.ComputeSurfaceFrameNew
, it uses parallel transport.
Dark Jeremy wrote HullBrush
and that made the concept of "Knot" kind of weird. ParentBrush
was an experiment
The BatchManager
was written because "1 GameObject
per stroke" is obvs not scalable. So it's a way of taking a bunch of tiny meshes, all of the same material, and grouping them into larger meshes. The tiny meshes become a "BatchSubset
" within a larger mesh "Batch", and a single material ("BatchPool
") will have multiple meshes ("Batches") and the whole thing is orchestrated by BatchManager
.
Coordinate Systems
From BaseBrushScript
:
User Brushes
In your Open Brush folder there will be a folder called 'Brushes'. You can create subfolders in that folder for your own user brushes. There is a Brush.cfg
jspn file in which you have to specify a name, a guid, and the brush it is a variant of. You can then also add in a new main and normal texture if you want.
Last updated