Skip to content

Tutorials · Worlds and Levels · Chapter 8

The meadow

40 minutes Uses: MultiMesh, Polygon

By the end

  • A MultiMesh, meadow, in place of meadow-block: its Polygon drawn into one blade of grass, 3 wide and 12 tall, on Props
  • Its Placements painted with the Scatter brush in one stroke along the east crest’s turf: blades no nearer than 3, turned up to 12° either way, 0.75 to 1.25 of their size, tinted between two greens
  • The whole meadow drawn in one draw
On this page

When to reach for a MultiMesh

The east crest is still crossed by a grey strip, meadow-block. This chapter replaces it with grass.

Reach for a MultiMesh for many copies of one shape: grass, pebbles, rubble, stars. It draws the Polygon or Mesh on its own node once at each of its Placements, each copy placed, turned, sized and tinted its own way, all in a single draw, and adds no node for a copy: a hundred blades are one row in the Hierarchy.

What collides, what draws, what sorts: a MultiMesh draws its shape at every placement and collides with nothing, so he walks through the grass. It sorts on the shape’s Sort Layer: the blade’s Props, in front of the hills and behind him on Figures. With no Polygon or Mesh beside it, there is nothing to draw, and Problems says so: “This MultiMesh has no Polygon or Mesh on its node, so there is no shape to draw at its placements — add a Polygon here, or a Mesh”. The preset comes with its Polygon, so the row never shows here.

The preset

  1. With scenes/vale.ron open, select meadow-block, press Delete, and press Delete in the box that asks.
  2. Select vale, press + Add node and choose MultiMesh: the menu lists it after Polygon.
The vale at 200% round the hut, the meadow block gone: a new node, MultiMesh, selected at the foot of the Hierarchy under vale; in the Viewport three small squares in a row on the walking line at the origin, left of the hut, each outlined; the Inspector shows Name MultiMesh, Position 0.0 and 0.0, its MultiMeshComponent with Placements, 3 items, and its PolygonComponent with Points, 4 items, -8.0 and -8.0, -8.0 and 8.0, 8.0 and 8.0, 8.0 and -8.0, a white Color; the status line says 1 to undo
A new MultiMesh: a 16-unit square, drawn at three Placements.

The preset is a Polygon, a white square 16 across, beside a MultiMesh of three Placements along the node’s line: three copies of the square, so the node is never a MultiMesh without its shape. A node Add node puts here stands at 0, 0.

  1. Rename the node meadow and type its Position 1640, 0, where the grey meadow stood. Press Frame, and pick 400% from the zoom menu at the Viewport’s foot.

One blade

The shape is the blade: three points, 3 wide at its foot and 12 tall, its foot on the node’s origin, so each copy stands on its Placement’s Position and turns about its foot.

  1. With Snap off, hover the square’s top-right point and press Delete: three are left.
  2. Drag the three, in the order the list holds them, onto the table’s [0], [1] and [2], and type each in the Inspector so it is exact.
  3. Set the Polygon’s Sort Layer to Props. Leave its Color white, Texture none, Fit Stretch, Tile Scale 1 and Opaque unticked.
Pointsxy
[0]-1.50
[1]1.50
[2]0-12
meadow selected and framed, the view at 400%: three white blades of grass standing on its line, sunk in the east crest under its turf, the middle one with a square handle on each of its three points; the sun large in the sky behind; the Inspector shows Name meadow, Position 1640.0 and 0.0, its MultiMeshComponent with Placements, 3 items, and its PolygonComponent with Points, 3 items, -1.5 and 0.0, 1.5 and 0.0, 0.0 and -12.0, a white Color, Texture (none) and Fit Stretch
The blade, at the preset’s three Placements: sunk in the hill, under the turf.

The preset’s three copies stand on the node’s line, y 0, inside the crest under its turf. The brush will put each blade on the turf instead, so these three go.

  1. In the MultiMesh, press the bin beside Placements’ [0] three times. The list is empty, and the meadow draws nothing.
Placements
Where the shape is drawn: one copy at each placement, each opened by its arrow. + adds one at the node’s origin and the bin takes one off. Empty draws nothing, on purpose.
The placement’s Position, Rotation, Scale and Color
Position is the copy’s place in the node, where the shape’s origin goes. Rotation turns it about that point, in degrees, 0° upright, as the Inspector shows every rotation. Scale sizes it, across and down. Color is a tint multiplied with the shape’s own colour: on a white blade, the blade’s colour.

Painting the grass

The Placements are painted with the Scatter brush: a stroke in the Viewport adds a placement under the pointer each frame, each turned, sized and tinted by the Scatter panel’s settings.

  1. With meadow selected, click the Scatter tab beside the Inspector, and choose the Scatter tool on the toolbar, or press U: a stroke in the Viewport now paints.
The Scatter panel with meadow selected, as it opens: the Tool, Place lit beside Erase; Artifact, torch; Placement, Spacing 24 u, Snap 0.0 u, Rotation 0°, Scale 0.000 and Seed 1 with Reroll; Target, Nodes lit beside MultiMesh, and 0 in this scene
The Scatter panel as it opens: its Target on Nodes.
  1. Under Target, click MultiMesh: the Artifact list goes, the panel says meadow: 0 placements, and Tint appears. Leave the Tool on Place.
  2. Set Spacing to 3 and leave Snap at 0. Set Rotation to 12° and Scale to 0.25. Leave Seed at 1.
  3. Click each Tint swatch and, with the picker reading F, set the first and the second from the table below.
TintTypedOn the screen
The first0.1706, 0.4480, 0.0732, alpha 10.45, 0.70, 0.30
The second0.5705, 0.7106, 0.1473, alpha 10.78, 0.86, 0.42
  1. Pick 100% from the zoom menu at the Viewport’s foot, and find the east crest, between the mere and the ravine: from x 1440 to 1840 it is all in view. Press on the top of its turf at x 1440, and drag east along the turf’s top to x 1840 before letting go: the cursor row at the Viewport’s foot says where the pointer is. Press Ctrl+S.

Each frame of the stroke, the brush puts a blade where the pointer is, unless one already stands within 3 of it. Your stroke places its own blades; the checkpoint’s laid 134, turned from -11.9° to 12.0° and scaled from 0.751 to 1.249, every one tinted between the pair, and no two feet nearer than 3.

The Inspector on meadow from its MultiMeshComponent down: Placements, 134 items, [0] open: Position -200.0 and -0.036, Rotation 1.59°, Scale 1.223 and 1.223, a light green Color; then [1], [2] and [3] closed
The checkpoint’s painted Placements: the first, 200 west of the node, its Rotation 1.59°.
The Scatter panel’s Tool: Place and Erase
Place, as it comes, puts copies along a drag. Erase takes off the ones within its Radius of the pointer.
The Scatter panel’s Target: Nodes and MultiMesh
Where a stroke’s copies go. Nodes, as it comes, makes one node per copy of the artifact picked in the list above. MultiMesh adds rows to the selected node’s Placements instead, its own shape the copy: no nodes, one draw. It is offered while a node with a MultiMesh is selected, and the panel says the node and its count, meadow: 134 placements.
Spacing
How far apart two copies must be: a stroke places none within it of another. At 3, a blade’s 3-wide foot just meets the next one’s; 0 places one at every move of the pointer.
Snap
Puts each copy on a grid of this size; 0, as it comes, places it where the pointer is.
The Scatter panel’s Rotation
How far each copy is turned at random, either way, in degrees, as a placement’s Rotation reads: at 12°, each blade leans up to 12° left or right.
The Scatter panel’s Scale
How far each copy is sized at random, either way, as a fraction of one: at 0.25, each blade is from 0.75 to 1.25 of its size, the same across as down.
Tint
Two colours; each copy is tinted somewhere between them, by the seed. Typed in linear light, as every colour is. Only for a MultiMesh target, and both white leaves the shape its own colour.
Seed and Reroll
Where the random turns, sizes and tints start: the same seed scatters the same way twice. Reroll moves to the next one. The panel’s settings are its own and are not saved with the scene; what is saved is the placements a stroke made.

The cost: one draw

Press Run game and hold D onto the east crest. The grass stands along the turf over the crest, every blade leaning and sized its own way, between the two greens.

A part of the game: him standing on the east crest among the grass, blades of many greens along the turf over the crest, each leaning its own way and standing its own height; behind, the town’s houses and spire against the dusk
The meadow over the east crest.

With him on the crest, 107 of the 134 blades on the screen, the whole meadow is one draw, of the blade’s one triangle, 134 times: one draw more than with the meadow hidden, and 134 triangles. And it collides with nothing: from the meadow’s west end, a second of D takes him exactly as far through the grass as with the meadow removed.

Under the grass, the turf runs unbroken over the east crest, which the grey strip hid until now, and into both lips’ joins with their hills.

The meadow

Fieldmeadow
Node Position1640, 0
The Polygon’s Points-1.5, 0; 1.5, 0; 0, -12
The Polygon’s Color, Sort Layerwhite, Props
Placementspainted in one stroke over x 1440 to 1840
ScatterSetting
Tool, TargetPlace, MultiMesh
Spacing, Snap3, 0
Rotation12°, either way
Scale0.25, either way
Tintthe table above
Seed1

meadow-block is gone.

Check it works