public readonly record struct TerrainBrushThe one brush every terrain and foliage tool stamps with.
Remarks
One service, three consumers, and that is the whole point. Sculpt strength over a falloff, paint weight over a falloff and foliage density over a falloff are the same function applied to different targets. Unreal implements them three times, so a soft edge sculpted at strength 0.3 and a soft edge painted at strength 0.3 are different shapes. This answers one question — what weight does this stamp have at this world-space sample — and does not know what the answer will be multiplied into. It is [docs/plan/24 § D4]'s argument for SnapContext, applied again.
Metres, not texels. A radius is a distance in the world, so the same brush is the same size on a terrain at one metre per quad and on one at four. A brush measured in samples would change size when somebody changed the resolution, which is the setting most likely to change after the art is made.
⚠ Falloff is the fraction of the radius that falls off, not where the falloff starts. Zero is a hard-edged disc and one falls off from the centre. Reading it the other way round gives a brush that is hardest where it should be softest, and the result still looks like a brush — which is why the direction is stated here and asserted in the tests.
Fields and properties (11)
public float RadiusHow far the brush reaches, in metres. Positive.
public float StrengthHow hard it presses, 0…1. Scales every weight it returns.
public float FalloffWhat fraction of the radius is falloff rather than plateau, 0…1.
public BrushFalloffKind CurveWhich falloff curve.
public BrushShape ShapeWhat footprint it has.
public float SpacingHow far apart stamps are along a stroke, as a fraction of the radius. Positive.
public BrushRotation RotationHow the stamps are turned.
public float AngleThe brush's own angle in radians, used by Fixed.
public float PatternScaleHow many metres of world one tile of a Pattern mask covers.
public static TerrainBrush DefaultThe default: a soft circle a metre across, at half strength.
public float StampDistanceHow far apart this brush's stamps are, in metres.
Methods (2)
public float WeightAt(Vector2 sample, BrushStamp stamp, IBrushMask? mask = null)The weight this brush applies at a world-space sample, for one stamp.
public BrushFootprint FootprintOf(BrushStamp stamp)Everything a stamp can touch, in world XZ.
Used by (23)
- BrushStrokeVixen.Terrain
- BrushStrokeTestsVixen.Terrain.Tests
- TerrainBrushTestsVixen.Terrain.Tests
- TerrainHeightmapPngTestsVixen.Terrain.Tests
- TerrainHeightmapTestsVixen.Terrain.Tests
- TerrainLayerTestsVixen.Terrain.Tests
- TerrainPaintVixen.Terrain
- TerrainPaintTestsVixen.Terrain.Tests
- TerrainRendererTestsVixen.Rendering.Terrain.Tests
- TerrainSculptVixen.Terrain
- TerrainSculptTestsVixen.Terrain.Tests
- TerrainSplatTestsVixen.Rendering.Terrain.Tests
- TerrainStoreTestsVixen.Terrain.Tests
- TerrainStrokeVixen.Terrain
- TerrainStrokeTestsVixen.Terrain.Tests
- TerrainWeightStrokeVixen.Terrain
- TerrainWeightTestsVixen.Terrain.Tests
- TerrainWeightmapTestsVixen.Terrain.Tests
- TerrainBrushSettingsVixen.Editor.Terrain
- TerrainEditVixen.Editor.Terrain
- TerrainHoleStrokeVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests
- TerrainPanelTestsVixen.Editor.Terrain.Tests