docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Other Useful Tools

    • Mesh Stamping
    • Terrain splitting tools
      • Add Rules Components
      • Remove Terrain Outside Bounding Box
      • Compute Visibility Data
      • Clear Visibility Data
      • Use visibility Data
      • Split a terrain

    Mesh Stamping

    The mesh stamping tool lets you stamp any arbitrary mesh onto the terrain with a different degree of resolution.

    To mesh stamping, follow these steps:

    1. Place an object that contains a Mesh on the terrain.
    2. Right click on the object and then select Terrain->Paint Selection.

    alt_text

    The Paint Selection Settings window opens to show the different stamping options you can choose from:

    Stamping options
    alt_text
    • From Top: Select to adjust terrain height from the top of the object. Deselect to adjust terrain height from the bottom of the object.
    • Strength: Use the slider to specify the strength of the stamping
    • Height Offset: (optional) To avoid conflicts on the Z-axis, specify an offset value.
    • Selected Objects: Identify the objects you want to use for the stamping
    • Include Children: Select to include children for the object.
    • Smooth Radius: Specify the radius you want the system to use to smooth the stamping and terrain.

    Examples

    Example Image
    alt_text
    alt_text
    alt_text
    alt_text
    alt_text
    Smoothing Radius value of 10

    You can see that the bottom is smoothed with the terrain
    alt_text

    Terrain splitting tools

    Add Rules Components

    We made a small utility to use a rule-based paint tool to add all the components you need to paint.

    To access it, follow these steps:

    1. Right click on a Terrain.
    2. Select Add Rules Components

    alt_text

    The tool automatically adds the correct components to enable rule-based painting.

    Components Descriptions
    alt_text
    • Scattering Rules: Container that holds all the rules the terrain will use.
    • Scattering Rules Bridge: Component that handles the how rules paint and exclude zones.
    • Splatmap Update Manager: Component that handles how the system splats the GameObject into terrain splat maps.
    • Tree Prototype Extension Data Provider: Components that let you add new functionality to a TreePrototype. In this template, we use them to add new data to the TreePrototype instances.
    • Detail Prototype Extension Data Provider: Components that let you add new functionality to a DetailPrototype. In this template, we use these components in code to add new data to the DetailPrototype instances.

    Remove terrain outside bounding box

    The Remove Terrain Outside Bounding Box tool deletes any terrains that are not contained within the bounding box of the objects you select.

    1. Select the terain(s) you want to test and then right click.
    2. In the menu that appears, select Remove terrain outside bounding box.
      alt_text
      A new dialog shows the terrains you selected and an empty list of exclusion boxes.
      alt_text
    3. Use your mouse to select any objects and drag-and-drop them in the exclusion boxes section of the dialog. The system uses the objects you selected to calculate the combined bounding box.
    4. Select Apply.
      alt_text
      The system deletes any terrains that don't intersect with the bounding box.
      alt_text

    Compute Visibility Data

    The Compute Visibility Data tool lets you compute visibility from one terrain to another.

    Steps:

    1. Right Click on the terrains you want to compute visibility data for and then select Terrain > Compute Visibility Data.
      alt_text
      Once the system completes the calculation, you can see a new Terrain Visibility Data component on each terrain you selected.
      alt_text
    2. Specify options for the calculation:
    • Check Bounding Corners: Select to also shoot a ray for each corner.
    • Check Neighbors: Select to set the terrain to accessible if all neighbors are accessible.
    • Forced Enable Tile: Terrains that are forced to visible.
    • Visible Tiles: Show all the visible terrains
    • Forced Disable Tile: Terrains that are forced disabled.
    • Disable Tiles: Show all the disabled terrains.
    • Draw Debug: Highlight the visible tiles in green and obstructed tiles in red.

    By default, the system performs the visibility data calculation as follows:

    1. The system casts a ray from the center of a terrain to the center of the other terrain.
    2. It detects anything that intersects with the ray other than the selected terrains.
      alt_text

    Detecting Visibility Blockers

    To place a visibility blocker, follow these steps:

    1. Add any type of object.
    2. Set the layer for the object to TerrainVisibilityBlocker.
    3. Recompute the the visibility data. It should look like this:
      alt_text

    Clear Visibility Data

    To clear visibility data, follow these steps:

    1. Select the terrain you want to clear visibility data for.
    2. Right-click and navigate to Terrain > Clear Visibility Data.

    alt_text

    Use visibility data

    Before you can use visibiliity data, you must add a Terrain Visibility Updater component to any of the objects.

    The component controls the way the system hides or shows terrain based on the view Frustrum.

    alt_text

    alt_text

    Split a terrain

    For information on splitting terrain, see: https://docs.unity3d.com/Packages/com.unity.terrain-tools@2.0/manual/toolbox-terrain-edit.html#split

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)