Legacy:SpeedTree Using In UT2k3-2k4 - Unreal Wiki

# Legacy:SpeedTree Using In UT2k3-2k4

### From Unreal Wiki, The Unreal Engine Documentation Site

"SpeedTree Using In UT2k3-2k4"

LOOK ON A SCREENSHOT

Actor >> SpeedTreeActor
SpeedTreeActor USource

    class SpeedTreeActor extends Actor
            native
            placeable
            hidecategories(Movement,Collision,Lighting,LightColor,Karma,Force);

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Default Textures

    // Default Placeholder Sprite
    #exec TEXTURE IMPORT FILE=Textures/SpeedTree.pcx NAME=SpeedTreeIcon GROUP=SpeedTree MIPS=1 MASKED=1

    // Default Tree Textures
    #exec TEXTURE IMPORT FILE=Textures/DefaultBark.dds NAME=Bark GROUP=SpeedTree MIPS=0
    #exec TEXTURE IMPORT FILE=Textures/CompositeLeafMap.dds NAME=CompositeLeaf GROUP=SpeedTree Mips=0 AlphaTexture=1

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // UnrealEd Interface

    // Shared SpeedTree Object
    var (SpeedTreeActorShared)           const SpeedTree                SpeedTreeObject;                        // The unique USpeedTree object this actor shares (be careful editing!)
    var (SpeedTreeActorShared)           const int                     nRandomSeed;                    // the SpeedTree's random seed value (affects the tree creation), 0 = random seed every creation, 1 = use value stored in the SPT file
    var (SpeedTreeActorShared)           const string          strSPTFile;                             // the name of the spt file to load
    var (SpeedTreeActorShared)           const float                   fWindStrength;                  // the wind strength
    var (SpeedTreeActorShared)           const vector          vWindDirection;                         // the wind direction
    var (SpeedTreeActorShared)           bool                           bUseWindyBranches;              // whether the branches sway or not (more computation, but looks better)

    // Flags
    var (SpeedTreeActor)                         bool                           bUseLeaves;                     // whether it draws leaves or not
    var (SpeedTreeActor)                         bool                           bUseBranches;                   // whether it draws branches or not
    var (SpeedTreeActor)                         bool                           bUseFronds;                     // whether it draws fronds or not
    var (SpeedTreeActor)                 bool                           bUseBillboards;                 // whether billboards are drawn at the lowest LOD or not
    var (SpeedTreeActor)                 bool                           bCullBranchBackfaces;           // whether the branches cull backfaces or not (some trees like bamboo need to be double-sided)
    var (SpeedTreeActor)                 bool                           bShowCollisionCylinder;         // draws the collision cylinder for collision tuning

    // LOD
    var (SpeedTreeActor)                 float                          fNearLodScale;                  // the distance for the most detailed tree
    var (SpeedTreeActor)                 float                          fFarLodScale;                   // the distance for the lowest detail tree
    var (SpeedTreeActor)                 float                          fOverrideLodLevel;              // The tree will use this LOD level (0.0 - 1.0). If -1.0, the tree will calculate its LOD normally

    // Material Data
    var (SpeedTreeActorMaterials)        material                      matCompositeLeaf;                       // the composite leaf material
    var (SpeedTreeActorMaterials)        material                      matBranch;                              // the branch material
    var (SpeedTreeActorMaterials)        material                      matFrond;                               // the frond material (often the same as the composite leaf)
    var (SpeedTreeActorMaterials)        color                          colorAmbient;                           // helps to match the speedtree to the level's ambient lighting
    var (SpeedTreeActorMaterials)        float                          fBranchAmbientMultiplier;               // branch ambient adjustment (multiplied by ambient color for the branches)
    var (SpeedTreeActorMaterials)        float                          fFrondAmbientMultiplier;                // frond ambient adjustment
    var (SpeedTreeActorMaterials)        float                          fLeafAmbientMultiplier;                 // leaf ambient adjustment
    var (SpeedTreeActorMaterials)        float                          fBillboardAmbientMultiplier;    // billboard ambient adjustment

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Other Variables

    var    private        transient                      float                          m_fDeltaTime;           // global time for wind calculations
    var    private        transient                      bool                           m_bIsInitialized;       // flag to see if actor is initialized or not

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Default Properties

I'd downloaded SpeedTree Demo for Unreal Runtime 22.26.20.02 (it goes well at 2226.19.03), demo don't have Editor, but if you install Unreal Runtime and copy files from SpeedTree demo you may access to SpeedTreeActor and to SpeedTreeRT.dll library. And you may create new trees with this technology I don't well know Unreal Script, but if you guys know how to implement it in UT2k4. Please Post it.

## Comments:

Jan: SpeedTree needs an native C++ object/class in Engine.dll which not exist in UT2k3/2k4. Btw. you cannot add this without the Engine headers/sources.

Nemesisd: Yes I think so too, but look here Native Coding. I don't really know if Epic giving access to the headers of Unreal Engine.

##### Views

- Legacy
- Discussion
- Current revision

##### Search