Red Herring’s Shrubbery Creator

This page describes the Shrubbery asset for Unity which lets you place grass and detail meshes on any surface, not just terrain.  This can be used to place additional static mesh data like weeds growing through cement in a building, mushrooms on trees or random garbage.  This asset will allow you to increase the realism of a scene by adding a large number of small detailed objects in any scene at very low overhead.

Image showing grass on a sphere, a cylinder and a plane.

Grass on arbitrary surfaces.

Detail rock meshes attached to the sphere and cylinder

The interface is very easy to get started and use as shown below.

First add the Shrubbery component to an asset you want to add details to.

Component->Mesh->Shrubbery

This will bring up a UI in the Inspector view like this:

ShrubberyEditor-FullView

  • Brush Options
    ShrubberyEditor-BrushOptions

    • Radius defines how large an area grass or details will be drawn within.

    • Strength defines how many instances of grass or details will be drawn with each move of the mouse.

    • Max Paint Angle describes the steepest angle that can be painted onto (90 means all can be painted, 0 means only perfectly horizontal surfaces)

    • The Vertical to Follow Normal slider defined whether or not the grass will stay strictly to the global vertical or blender more to match the underlying object’s normal.  Since grass tends to grow upwards you may always want some amount of this blend to keep the grass pointing upward.

    • Vertical Jitter defines how much randomness away from vertical the grass will be created.  This keeps it from all pointing in exactly the same direction as you draw.
  • Brush type, Grass Textures – These are the grass icons available to be drawn. Left clicking selects or deselects a grass icon for drawing.ShrubberyEditor-GrassTextures
    • Scale defines how large the grass will draw.

    • Variance defines how widely varied the scale will be.  Zero variance means the grass will always be drawn at scale.  Variance of 1 means the scale could be up to twice as large.

    • “Apply” will apply any scale and variance changes to already placed grass of this type.

    • Normal and Waving refer to the tint color when the grass is at normal position and when it is bent by the wind, respectively.

    • “Remove All” will remove all instances of the grass texture.

    • “Change” will allow you to change the grass texture of the icons already placed.

    • Add Grass Texture will bring up a window to let you browse for a new grass texture to add.  Remove Selected will remove the icon and all instances with it from the scene.
  • Brush type, Details Meshes – These are the icons for the detail mesh instances. Left clicking will select/deselect it for drawing.ShrubberyEditor-DetailMesh
    • Scale, Variance, Apply and Remove All options work the same as the grass

    • Add Detail Mesh will bring up a window to let you pick the mesh and material to add to the set.  Remove Selected will, like the grass, remove the mesh from the set and all associated instances in the scene.
  • Other Options, PerformanceShrubberyEditor-Performance
    • Fade Distance defines when the instances will start to fade and Max Distance defines when they will be completely transparent.  Currently only the grass fades out.

    • Optimize Distributions will be clickable when there are enough instances to require it.  This redistributes the instances among container objects so that they are more tightly packed, which is more efficient for culling and lighting.
  • Other Options, “Light”ShrubberyEditor-Light
    • Cast and Receive shadows control the shadows for the instances

    • Recalculate Lightmaps will, if there are lightmaps defined on this object, iterate through all instances and set the lightmap parameters equal to the lightmap of the object at the position where the grass or detail is defined.  Lightmaps will be constant for all grass or detail mesh vertices based on the assumption these will be small relative to the whole level.
  • Other Options, “Wind”
    • Normal Wind – Creates a regular set of wind in one directionShrubberyEditor-NormalWind

    • Noise Wind – Like normal wind, but the strength is modulated by a noise textureShrubberyEditor-WindNoise

    • Vector Wind – The direction of the wind at each point is described by the texture, much like a normal map defines bumps.ShrubberyEditor-WindVectors
  • Other Options, “Misc”ShrubberyEditor-Misc
    • Ignore Grass Select means that grass won’t get in the way of selecting the underlying object you’re trying to paint onto.

 

To add one or more grass or detail meshes at a time

View of drawing into the scene

  • Select them so they are highlighted in green.
  • Right click or press the small right arrow to adjust the scales, if needed.
  • Draw by ctrl-left-clicking within the scene view at the location on your object that you want to start drawing.
  • Drag the mouse while holding the button to paint details onto the object.

You can also delete within the scene view by ctrl-right-clicking and dragging.  You can also change the size and strength of the brush directly in the scene view by holding ctrl-alt and ctrl-shift, respectively, while moving the mouse

The green wire spheres shown in the image above will show up after running “Optimize Distributions” at least once.  They are centered on a cluster of grass instances and sizes according to the size of that instance. These will show green or red depending on whether the grass clusters are being culled while playing (if gizmos are displayed).

 

  1. No comments yet.
(will not be published)
*

Switch to our mobile site