SpeedTree

From HEWIKI
Jump to: navigation, search

He intermediate.png

Contents


SpeedTree 6.0 is now the supported version in the HeroEngine and HeroCloud. The HeroEngine specific SpeedTree 6.0 Modeler can be found in the downloads section of your active world at account.heroengine.com.

Simple SpeedTree 6 for HeroEngine Tutorial





SpeedTree Discussion During Development

Check out this forum thread with some SpeedTree 6.0 images from inside the HeroEngine's current development branch. [SpeedTree 6.0 Preview]

SPT601.jpg




Adding Legacy SpeedTree 4.2 Trees to Your HeroEngine 1 World

THIS IS LEGACY 4.2 SPEEDTREE SETUP. You will not follow any of these instructions now that SpeedTree 6.0 is released, unless you are a source code developer that is not upgrading to HeroEngine 2.

Trees can be added from the library, which is located under /program files/speedtree/. The library for us serves as a base template to create our own trees from. Using any one of these, you can replace all the textures and create whatever tree you desire.

First thing to do, is find a tree in the library that you like and open it up.

There is now an additional tutorial from user info360Covers outlined at the bottom of this page that some users have found to be additionally helpful.


Save File Location

Right away, we are going to use Save As for this tree into the matching location of the Repository where all your SpeedTrees are going to be kept. I'll be doing a demo tree called demo_cypress.spt

When you save out the tree to a new location it will give you a local map not found and will prompt you to copy them into the same directory as the .spt file. Click yes to all.

Local map not found box.jpg


SpeedTree Parameters

There are a ton of parameters to alter and fiddle with, most of which are curve-based. It takes a bit of time to get used to them and to be able to predict how your tree is going to change. It's best to just experiment with them for a while to get the hang of it.

Paramerter tab window.jpg


Textures

Most of the trees come with a bark texture, 2 leaf textures, 1 frond textures, and a self shadow texture. If you would like to use the self shadow,360 Billboards, and Fruit bits, these options now supported by Hero Engine.


Once you're done editing and manipulating your creation, you're going to open the bark texture in Photoshop. Make any color or texture changes that you feel will work best for the look and feel of your tree now. *You'll want to make these changes at the higher res .tga because you have greater control and less image quality loss when resaving .tga's as opposed to making and resaving the .dds files. This is important for the bark texture because it is not included in the Composite Map, however it is referenced during the generation of the billboard image. Most bark textures come in 256x1024 or of some elongated proportion. The goal is to get it to occupy a 256x256 or equivalent space. You can squash into a 256x256 or What I like to do, is keep its proportion and just shrink it down so that its the same file size as 256x256. Hence the 256x1024 becomes a 128x512.

If you are happy with your bark, you can save it out to a .dds Texture file and create a normal/spec map for it just as you would create any another .dds texture.


The Leaf and Frond textures will eventually end up in a Composite Map and in an ideal situation you only want each map to represent a 256 x 256 space. Make color adjustments on these and size them down to this resolution. You'll want these maps square in most cases because it makes setting up the embedded texture coordinates a little less painful later on. In this particular case my Leaf 1 texture is 256x128, So, I'm going to add some space to make it square and also expand the background texture a bit. Don't forget about scaling and editing the alpha channel appropriately to match the shape edits on the RGB channels. The resulting .tga's look like this.


If you would like to replace the Leaves or Fronds texture with new textures you created, click on the browse [...] dialogue box and load the different .tga files.

Next, click on the thumbnail in the panel to adjust the pivot point. The texture will pivot around the point which you designate here.

Leaf pivot box.jpg

The yellow + on the image is the pivot point of the texture. When you look at a tree in HeroEngine and move around it, you'll notice the leaves always face the camera.


Composite Map

Now you need to create a composite map.

ST composite map v4.jpg

Keep all the default options except the following:

This will reduce headaches as your SpeedTree output grows.

ST composite map panel v4.jpg


Sometimes going back a second round and replacing the LOD billboard with a snapshot of the tree from HeroEngine can help with achieving a more cohesive look - use your own discretion. Also replacing the white on the billboard with the prominent color of the tree can help in some situations as well. If you are using 360 billboards, you can use as many or as few of them as would like. For example by default there is 6, we have found that 4 works rather well.

Tree File Modification Detected

This file has been modified externally. This could be due to exporting a
composite map tree on top of the original.

Load the modified file?
Click Yes


Demo cypress composite.jpg


User data

Now we just need to declare a few items and we are finished.

In SpeedTreeCAD, go to Edit > User data... from the main menu. Enter the names of your textures with the following format (as of version 2009.1):

CompositeDiffuse = CompositeMapDiffuse.dds
CompositeNormal = CompositeNormalMap.dds
BarkDiffuse = BarkTexture.dds
BarkNormal = BarkNormalMap.dds
BarkDetail = BarkDetailMap.dds
SelfShadow = SelfShadowMap.dds

In this format, the textures can appear in any order. CompositeDiffuse and BarkDiffuse are required; others are optional.

CompositeMapDiffuse.dds
BarkTexture.dds
BarkNormalMap.dds
SelfShadowMap.dds
CompositeNormalMap.dds
BarkDetailMap.dds


ST user data menu v4.jpg ST user data v4.jpg


Embedded Texture Coordiantes


The next thing to declare is Embedded Texture Coordiantes which can be reached by the Edit > Embedded texture coordinates... menu. You can copy them from a tree that already has them or create them manually. It's best that you know the manual method first so that it is a clear understanding of the textures and how they are laid out. However Speedtree 4.0 is pretty good about getting these coordinates correct right away.

SPT embedded uv.jpg

You can have more textures divided up in different ways on there so long as you do the math to get the coordinates. However, this is your most common layout and easiest to work with.

Under the leaf section, click add. This is going to open up those grayed out number fields and it will be considered index 0. Those fields are asking for the UV coordinates of each corner of the space in which that specific texture is on the composite map.

SPT embedded leaf 02 uv.jpg

SPT embedded leaf 01 uv.jpg

SPT embedded frond uv.jpg

SPT embedded billboard uv.jpg

add coordinates for the self shadow map if you have decided to use one.

Alternatively, if you already have a functioning tree that uses these coordinates you can copy all and then paste all into your new tree.


Save and Upload

At this point save out you SpeedTree file again. Open up the Repository Browser. The only files that need to be uploaded are the .spt file and the dds textures.

From here you load the .spt file into HeroEngine just like a regular asset and you're done.


info360Covers' Tutorial

This is a recap tutorial from developer info360Covers that some developers have found useful and or more direct.

SPEEDTREE HERO EXPORT TUTORIAL You can browse the library of 4.2 [by downloading the library from your download page]

First thing you want to do is make a copy of the tree.

Always use the speedtree file “whateverthetreesname_RT.spt”. RT stands for real time (game engine use).

Lets convert the CurlyPalm.RT for Hero. I made a local directory to match the repo and copied the whole library there. The Curly Palm is located in C:\HE\world\livecontent\speedtrees\Yourname Trees\Palms_Cacti_&_Cycads\Curly_Palm on my local drive.

I made a copy of CurlyPalm_RT.spt and renamed it to CurlyPalm_RT_Yourname.spt. Reason for doing this is Speedtree will write to your master file if you do not.

Open up “CurlyPalm_RT_Yourname.spt” in SpeedTree CAD 4.2 Click on the “Composite Map” icon on the left hand side (the tenth button down, looks a keyboard with an arrow above it)

Composite map exporter dialog will pop up.

What is composite map export? It allows you to adjust billboard size/and how many billboard angles you want. At the same time it will make you a texture and normal map for the tree, it will then combine/composite the billboards and maps into dds files.

In the bottom right corner of that window set the project directory (“folder” field). Browse to C:\HE\world\livecontent\speedtrees\Yourname Trees\Palms_Cacti_&_Cycads\Curly_Palm Set the file name above that to something like Curly_Palm_Yourname, check “Convert branch map to dds” and select “.dds” from the dropdown menu next to it.

The box in the top left hand that says, for example, “ Composite map (1024x1024)” shows the overall map size, you can adjust it realtime.

To do so, in the lower left hand corner you will see “Adjust Billboard sizes” adjust the dial and see realtime how much space you are giving to the billboards(yellow blocks) and how much space you are giving to the bark and leaf (orange and green blocks) texture map. You can also change the billboard “count” above that.

Honestly 6 (the default) looks harsh when transitioning from the billboard LOD in Hero. Maybe 12 would be a good number, you can make them small since they will be distant. I have attached a screenshot of what my composite looks like, make sure you check those other options also to match the screenshot.

Click “OK” when you have everything ready.

I chose specular and detail in the composite options, the Curly Palm didn’t have either TGA for those, so I was greeted with a little error after it created the composite. No big deal, just ignore it.

Close the error box, another dialog box will pop up titled “File Modification Detected” saying your file has been modified, click yes. The tree will turn white. Now “file>save” from the menu.

You must now setup a user data file so Hero can read the tree info.

From the menu click “edit>user data” A user data input box will popup The layout/template for the user data information looks like this: CompositeDiffuse = CompositeMapDiffuse.dds CompositeNormal = CompositeNormalMap.dds BarkDiffuse = BarkTexture.dds BarkNormal = BarkNormalMap.dds BarkDetail = BarkDetailMap.dds SelfShadow = SelfShadowMap.dds

What we want to do is replace the above names with the DDS names of our newly generated Curly Palm dds files. Your generated CurlyPalm files will be located in C:\HE\world\livecontent\speedtrees\Yourname Trees\Palms_Cacti_&_Cycads\Curly_Palm . Edit it so it looks like the text below (or whatever you named your dds files) CompositeDiffuse = Curly_Palm_Yourname_Diffuse.dds CompositeNormal = Curly_Palm_Yourname_Normal.dds BarkDiffuse = CurlyPalmBark.dds BarkNormal = CurlyPalmBark_Normal.dds BarkDetail = CurlyPalmBark_Detail.dds

Notice I deleted the SelfShadow line. The CurlyPalm didn’t have a selfshadow. If the tree does have a shadow file it will be in that directory also, convert it to a DXT1 DDS and save it, then enter the name of the dds on the selfshadow line.

IMPORTANT MAKE SURE YOU SAVE THE FILE AGAIN, so the user data will be saved Copy Curly_Palm_Yourname_Diffuse.dds, Curly_Palm_Yourname_Normal.dds, CurlyPalmBark.dds, CurlyPalmBark_Normal.dds, CurlyPalmBark_Detail.dds and CurlyPalm_RT_Yourname.spt to it matching directory on the repo.

Common Errors

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox