meta data for this page
  •  

This is an old revision of the document!


Importing into UnrealEngine4 (ST9 Format)

SpeedTrees are supported in the UnrealEngine4 (UE4) game engine. The .ST9 files exported by SpeedTree 9 can be imported with Unreal Engine 4.27 or later.

Differences from ST

The importer for the ST9 format is a little different from the ST format in that it uses the idea of a master material that is used as the parent material for all the material instances made at import. This makes it easy for you to change one material and all your SpeedTrees get the changes.

Wind is also now done in the material editor and is fully computed on the GPU, rather than relying on CPU-side components as in previous versions. This makes it easy to tune wind parameters inside UE4, optimize rendering, and even change wind effect nodes all from inside UE4.

However, there may be times when you would want to use the legacy ST pipeline instead of the new pipeline. Since the wind is done wholly on the GPU, it is harder to change the frequencies of motion. For instance, if the wind strength changes dramatically and you wish to have leaves flutter faster, this would be more difficult in the ST9 wind (and require some work in blueprint). But for most cases of steady wind strength, and even changing wind directions, ST9 should be an easier, faster, and more configurable method of rendering SpeedTrees in UE4.

Pipeline to UE4

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

If this is the first time exporting to UE4, be sure to pick one of the UE4 presets in the export mesh dialog, to ensure all the export settings are correct for UE4. 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.

On import, material instances will be created for all of the materials in the ST9 file.

Placement

ue4_tree_in_scene.jpg 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.

ue4_painted_grass.jpg 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 can be tuned inside of the SpeedTree Modeler or in the material instances.

The wind strength used in UE4 is the same.

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

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.

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.