SpeedTree
    Show / Hide Table of Contents

    Place nodes on photogrammetry meshes

    Precisely locate a branch or leaf off a photogrammetry mesh using Target generators.

    The general approach is as follows:

    1. Add a Target generator as a child of the mesh.
    2. Use the Target to pinpoint a location/orientation on the mesh.
    3. Add any child as the child of the Target. The children of the target use the pinpointed locations and orientations as their starting point.

    The detailed process is outlined below.

    The setup

    To get started:

    1. Add a Mesh generator to your model.
    2. Import a mesh asset, make a material for it, and assign it to the Mesh generator.

    A generation hierarchy with a Tree generator and a Mesh generator.

    Add a target generator

    To add a target generator:

    1. Select the Mesh generator and add the "Single target" template. Choose any of the styles to mark a location on the parent mesh. You can choose to cast a ray at the parent, pick the closest point on the mesh, or use the target's position/orientation directly.
    2. Add a Branch, Leaf, or Mesh generator as the child of the Target. The new generators will use the spot marked by the Target as their starting point. Their initial orientation is controlled by the Point and Align options on the Target generator.

    A tree in the Tree Window with a Target generator at the end of a branch. In the generator hierarchy there is a Tree generator, a Mesh generator, and a target generator.

    Edit the result

    You can move a Target, change how the child is oriented, delete Targets, and add new ones. You can also add multiple Target generators and children if you'd like to position branches and leaves off a mesh.

    A GIF of a cursor adjusting a Target generator and corresponding branch on a tree.

    Placing welded branches

    When using Targets to place welded branches off photogrammetry meshes, beware of UV island seam crossings. Make sure the branch is located entirely within a single UV island to ensure no errors in the weld region.

    The following image shows a branch with a welding error both in the standard render mode and the texture coordinate seam render mode.

    A trunk and a branch with a weld error. The texture of the trunk and the branch do not match.

    The Texcoord Seam render mode illustrates why the error occurs:

    A trunk and branch with a weld error in Texcoord Seam render mode.

    Best practices

    Keep the following in mind when placing children off meshes with Targets:

    • This method doesn't work for procedural generation. Use 3D anchors instead.

    • Targets can be the children of anything, should you want to place things off regular SpeedTree geometry this way as well.

    • It's often a good idea to place a few procedural branches directly off a photogrammetry trunk to help with the blend between photogrammetry and procedural data.

    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.