Vixen
02b45cc4
csharp
public readonly record struct TerrainBrush

The one brush every terrain and foliage tool stamps with.

Read the guide page for this →

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 Radius

    How far the brush reaches, in metres. Positive.

  • public float Strength

    How hard it presses, 0…1. Scales every weight it returns.

  • public float Falloff

    What fraction of the radius is falloff rather than plateau, 0…1.

  • public BrushFalloffKind Curve

    Which falloff curve.

  • public BrushShape Shape

    What footprint it has.

  • public float Spacing

    How far apart stamps are along a stroke, as a fraction of the radius. Positive.

  • public BrushRotation Rotation

    How the stamps are turned.

  • public float Angle

    The brush's own angle in radians, used by Fixed.

  • public float PatternScale

    How many metres of world one tile of a Pattern mask covers.

  • public static TerrainBrush Default

    The default: a soft circle a metre across, at half strength.

  • public float StampDistance

    How far apart this brush's stamps are, in metres.

Methods (2)

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