SpeedTree
    Show / Hide Table of Contents

    Importing into Unreal Engine (Legacy)

    SpeedTrees are supported in the Unreal Engine game engine. The .ST files exported by SpeedTree 9 or later can be imported with Unreal Engine 4.19.2 or later.

    Pipeline to UE4/UE5

    Before exporting a tree for UnrealEngine, be sure that your tree is set up for real-time use by using LOD. Also ensure that wind is correctly set for UnrealEngine by setting the fan to Legacy UE4/Unity mode and tuning the wind effects, if necessary.

    If this is the first time exporting to UE, be sure to pick one of the UE4 presets in the export mesh dialog, to ensure all the export settings are correct for UE. Export an .ST file to disk, then switch to UnrealEd and import the ST file there. The mesh and all textures should be found and imported into your UE4 project assets.

    The UE4 importer window.

    On import in UE, you will be presented with a few options, such as whether to include the collision objects you have placed in the tree. The "LOD Setup" option allows you to select whether you wish to use SpeedTree-style LOD (with growing/shrinking geometry) on a static mesh actor, or UE4's crossfaded LOD which will also work on painted foliage.

    It is recommended that you allow the importer to create materials for you, and tick the "Include Vertex Processing" option. This will create the materials for you and place the SpeedTree node into them with the correct settings for each draw call (based on the wind type and geometry type).

    Note

    At this time only crossfaded LOD will work on painted foliage.

    Placement

    A SpeedTree placed in a UE (Legacy) scene.

    Once you've imported the model as an asset you can place it in your scenes like you would any other static mesh. Simply drag the asset and drop it in the scene to place a model. Mark them as “static” to use them with Lightmass (you'll need a good lightmap uv) or “moveable” to have them be dynamically lit and shadowed.

    A SpeedTree placed in a UE (Legacy) scene. The foliage painting area is expanded to show that you can paint the tree like a static mesh.

    You can also paint the tree with a foliage layer. Drag the asset into foliage painting area and paint the SpeedTrees like any other static mesh. See UE4's foliage tool documentation for more information.

    Wind

    Wind behavior is tuned inside of the SpeedTree Modeler. To see the animation in UE4, you must add a WindDirectionalSource object. The “Speed” property controls the wind speed while the "Strength" property affects the blending of multiple sources together.

    Note

    You'll probably want to turn down the speed since the default is 1.0 (high wind).

    LOD

    Your LOD behavior is set in the SpeedTree Modeler, but you can adjust when the LOD changes occur inside of UE4. LOD transitions are based on screen space area, and these values can be edited in the static mesh editor associated with the SpeedTree model. Default values are chosen upon import that work for typical situations.

    Materials

    Texture samples in UE (Legacy).

    The SpeedTree materials created by the importer get the basics in place but can be edited to improve and tailor them to suit your scenes.

    The SpeedTree node connected to WorldPositionOffest is the only SpeedTree-specific component in the material. If you disconnect it, everything rendered with that material will be identical to a static mesh. With it connected you will get SpeedTree wind, camera-facing geometry, and smooth LOD transitions.

    There are several options available on the SpeedTree node.

    Property Description
    Geometry Type This setting controls what type of geometry is rendered and is set automatically by the importer. This value rarely needs to be edited.
    Wind Type This property controls the complexity/quality of the wind shader applied to the material. This value matches what you set in the Modeler. To optimize rendering, this value can always be dropped down from where it was when imported. If you wish to go up in quality, you will need to go back to the Modeler to re-tune that higher wind effect before exporting and re-importing.
    LOD Type Use this to control whether SpeedTree models smoothly transition between LOD states or pop between them like standard static meshes.
    Billboard Threshold This option is unused with ST files
    ExtraBendWS To achieve additional bending effects on a tree, such as from explosions or player interactions, you can provide a Vector3 input giving the unnormalized direction you wish the tree to bend. It uses the same info about the tree as the shared/global bending to achieve this additional direction.

    Billboard materials contain a few extra material functions that remove non-camera-facing polygons from the billboard mesh and adjust the normals to avoid seams in the billboard mesh. These can be opened up for editing, as well.

    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.