public static class TerrainPaintThe paint kernels: what a stamp does to the layer weights under it.
Remarks
Four tools over the selected target layer — [docs/plan/31 § The paint tools]. Paint raises its weight and lowers the others proportionally, Smooth averages, Flatten sets it to the brush strength, and Noise scatters it. They are the sculpt tools' shape applied to a different target, which is [§ D12]'s argument for one brush.
⚠ Every one of these goes through Paint rather than writing a channel. That method is where the sum-to-one invariant lives — raise one layer and the rest come down in proportion, by largest remainder — and a kernel that wrote the byte itself would be a second implementation of the rule, disagreeing with the first by a unit or two per sample. Which is exactly the drift Verify reports and nobody can explain.
⚠ The target layer is an index and the tools do not check it against the brush. A paint layer has no lock and no generator — that is the edit layer stack, which is a different thing with a similar name. What refuses a paint stroke is having no target selected, and that is the editor's question.
Methods (5)
public static TerrainRect AffectedRect(in TerrainDescription description, in TerrainBrush brush, in BrushStamp stamp)Which samples a stamp of this brush can reach.
public static TerrainRect Paint(Terrain terrain, int layer, in TerrainBrush brush, in BrushStamp stamp, int amount, IBrushMask? mask = null)Raises a layer's weight under a stamp, lowering the others proportionally.
public static TerrainRect Smooth(Terrain terrain, int layer, in TerrainBrush brush, in BrushStamp stamp, IBrushMask? mask = null)Averages a layer's weight under a stamp with its neighbours.
public static TerrainRect Flatten(Terrain terrain, int layer, in TerrainBrush brush, in BrushStamp stamp, float target, IBrushMask? mask = null)Sets a layer's weight under a stamp to a target coverage.
public static TerrainRect Noise(Terrain terrain, int layer, in TerrainBrush brush, in BrushStamp stamp, int amount, in TerrainNoise settings, IBrushMask? mask = null)Scatters a layer's weight under a stamp.
Used by (6)
- TerrainPaintTestsVixen.Terrain.Tests
- TerrainSplatTestsVixen.Rendering.Terrain.Tests
- TerrainWeightStrokeVixen.Terrain
- TerrainWeightmapTestsVixen.Terrain.Tests
- TerrainEditVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests