Q: Creating TreeFX Tree Models

Hi, I have been creating Tracks with 3D Trees using the TreePlanter App & 3D models from posts with free pre-made models. The linked post showcases trees made Via 'TreeIt'. I would like to make my own Tree models with Tree it or Blender but I need a step-by-step guide as I am new to AC 3D Modding. I have already viewed the CSP Tree GitHub Post.

 
I'm helping Abulzz with 3d trees for the Targa Florio project and so we recently worked out the basics. We're using Speedtree which isn't free (20$ a month) and we both use 3dsmax, so I can't help you with either Tree It or Blender but here's the workflow:

- I guess using Tree It you need to then import the tree model into Blender to check the materials.

- You need to have a diffuse texture file (the base texture with alpha-channel for transparency) and a normal texture file (with I think specular map as alpha-channel) in .dds format for each of the different materials you use, let's say one for bark and one for leaves with a normal map each.

- I guess Tree It generates the normal map .dds for you, if not you can use Photoshop with the Nvidia plug-ins or online services that generate it from the diffuse texture.

- If you use more than one material it should be combined into one multi/sub-object material (that's how 3dsmax calls it), so one material that contains the two sub-materials. When loading in the .obj-tree from Speedtree it's already configured like that so might be the same with Tree It.

- Now in each sub-material (or main material if you only have one) you need to set the normal map to 'normal bump map'. In 3dsmax it's slightly tricky as you need to go to the material, open the 'maps' section and then click on the 'Bump' map. Then next to the map's name instead of 'Bitmap' select 'Normal Bump'.
I'm sure it's quite different in Blender, probably more straight forward, but the setting should be there too.

- After that you can export the tree as .fbx into a folder that contains the .dds textures.

- Now open Assetto's Content Manager and on the top left go to 'tools'. Just below you should find 'creator tools', if not you have to activate the 'developer mode' in Content Manager. Click 'about' in the top right corner, then find the version number on the left and click on it 10 times or so until it will tell you that developer mode is enabled.

- You should now find the 'tree model converter' under 'creator tools'

- Launching it will give you the option 'convert tree model', just click on it, open the .fbx file and after a few seconds the little icon should turn green and a .bin file has been created.

- The .bin file is just a .zip file, if you link the programm you use for .zip to the .bin file it will open it and you'll find the textures, meshes and a tree.ini file in it.

- The generated tree.ini file will need some work, so open it up with notepad++ or just editor.

- 'height' and 'width' are just the base settings, the variation is set somewhere else (I'll explain further down). It's generated from the model's dimensions.

- the settings under shading will need some adjustment. For a start specular=0.02, subscattering=0.3, reflectivity=0.02 might be a good base but it also depends on the tree of course.

- 'use_ao_channel', we're still experimenting with it. The ao channel enhances the 3d effect by pre-darkening sections that are in the tree's own shade (there's probably a better explanation somehwere). I think it generally will look better with it, but it still needs experimenting.

- I'm not yet entirely clear yet on how to best set the other values.

- The LOD settings are quite straight forward. You don't have to have several levels of detail for the tree to work but it's still very helpful for the track to run smoothly. To have several LODs, just import all the different models into one file in Blender/3dsmax, make sure the pivot point is at the same spot for all, set the materials up as described above and then export them all together into one fbx. The 'tree model converter' tool will determine which mesh is which LOD by the amount of polygons.

- In the LOD settings you might want to change the distance settings, usually the switch-over point between the different LOD-meshes is set quite near and so it will be very visible. By setting the distances further you'll have the switch-over less noticeable but of course you'll sacrifice performance.

- Now the tree into your track, put the tree's .bin file into your track's folder under extension/trees

- You can now use the TreePlanter by FastFred (found here on racedepartment) to get it into the game. After starting Assetto with the right track and opening the TreePlanter app you should find it listed and you should be able to plant it. After pressing 'save' it should appear.

- When planting trees, TreePlanter will generate a trees_01.txt file. If you open that file you can set the size/angle/width/brightness variance.

- If you go to the track's 'extension' folder and open the ext_config.ini file you will find that TreePlanter has made an entry under [TREES] with the name of the trees_01.txt file used. You can have several .txt lists (for different trees, or different variance settings or so) with a name you choose yourself. TreePlanter just has the habit to mess with the ext_config.ini file and reset it to one list only. So make a backup and rename the lists manually. (I'll contact the creator of TreePlanter, maybe it can be made possible to work with several lists).


-> a few issues I ran into that might help.

- You can just open the .bin file and change settings in the .ini file or textures/meshes without needing to generate a new .bin in 'tree model converter'. Just make sure you don't have the .bin file open whilst running Assetto as the game tends to then crash.

- After you changed the tree.ini to your likings, it might be tempting to just copy it into the next tree's .bin file. If you do this, just make sure the names for the LOD meshes are still correct, otherwise it won't show anything.



This is all I can think of at the moment, if there are any more questions just ask!
 
Last edited:
I'm helping Abulzz with 3d trees for the Targa Florio project and so we recently worked out the basics. We're using Speedtree which isn't free (20$ a month) and we both use 3dsmax, so I can't help you with either Tree It or Blender but here's the workflow:

- I guess using Tree It you need to then import the tree model into Blender to check the materials.

- You need to have a diffuse texture file (the base texture with alpha-channel for transparency) and a normal texture file (with I think specular map as alpha-channel) in .dds format for each of the different materials you use, let's say one for bark and one for leaves with a normal map each.

- I guess Tree It generates the normal map .dds for you, if not you can use Photoshop with the Nvidia plug-ins or online services that generate it from the diffuse texture.

- If you use more than one material it should be combined into one multi/sub-object material (that's how 3dsmax calls it), so one material that contains the two sub-materials. When loading in the .obj-tree from Speedtree it's already configured like that so might be the same with Tree It.

- Now in each sub-material (or main material if you only have one) you need to set the normal map to 'normal bump map'. In 3dsmax it's slightly tricky as you need to go to the material, open the 'maps' section and then click on the 'Bump' map. Then next to the map's name instead of 'Bitmap' select 'Normal Bump'.
I'm sure it's quite different in Blender, probably more straight forward, but the setting should be there too.

- After that you can export the tree as .fbx into a folder that contains the .dds textures.

- Now open Assetto's Content Manager and on the top left go to 'tools'. Just below you should find 'creator tools', if not you have to activate the 'developer mode' in Content Manager. Click 'about' in the top right corner, then find the version number on the left and click on it 10 times or so until it will tell you that developer mode is enabled.

- You should now find the 'tree model converter' under 'creator tools'

- Launching it will give you the option 'convert tree model', just click on it, open the .fbx file and after a few seconds the little icon should turn green and a .bin file has been created.

- The .bin file is just a .zip file, if you link the programm you use for .zip to the .bin file it will open it and you'll find the textures, meshes and a tree.ini file in it.

- The generated tree.ini file will need some work, so open it up with notepad++ or just editor.

- 'height' and 'width' are just the base settings, the variation is set somewhere else (I'll explain further down). It's generated from the model's dimensions.

- the settings under shading will need some adjustment. For a start specular=0.02, subscattering=0.3, reflectivity=0.02 might be a good base but it also depends on the tree of course.

- 'use_ao_channel', we're still experimenting with it. The ao channel enhances the 3d effect by pre-darkening sections that are in the tree's own shade (there's probably a better explanation somehwere). I think it generally will look better with it, but it still needs experimenting.

- I'm not yet entirely clear yet on how to best set the other values.

- The LOD settings are quite straight forward. You don't have to have several levels of detail for the tree to work but it's still very helpful for the track to run smoothly. To have several LODs, just import all the different models into one file in Blender/3dsmax, make sure the pivot point is at the same spot for all, set the materials up as described above and then export them all together into one fbx. The 'tree model converter' tool will determine which mesh is which LOD by the amount of polygons.

- In the LOD settings you might want to change the distance settings, usually the switch-over point between the different LOD-meshes is set quite near and so it will be very visible. By setting the distances further you'll have the switch-over less noticeable but of course you'll sacrifice performance.

- Now the tree into your track, put the tree's .bin file into your track's folder under extension/trees

- You can now use the TreePlanter by FastFred (found here on racedepartment) to get it into the game. After starting Assetto with the right track and opening the TreePlanter app you should find it listed and you should be able to plant it. After pressing 'save' it should appear.

- When planting trees, TreePlanter will generate a trees_01.txt file. If you open that file you can set the size/angle/width/brightness variance.

- If you go to the track's 'extension' folder and open the ext_config.ini file you will find that TreePlanter has made an entry under [TREES] with the name of the trees_01.txt file used. You can have several .txt lists (for different trees, or different variance settings or so) with a name you choose yourself. TreePlanter just has the habit to mess with the ext_config.ini file and reset it to one list only. So make a backup and rename the lists manually. (I'll contact the creator of TreePlanter, maybe it can be made possible to work with several lists).


-> a few issues I ran into that might help.

- You can just open the .bin file and change settings in the .ini file or textures/meshes without needing to generate a new .bin in 'tree model converter'. Just make sure you don't have the .bin file open whilst running Assetto as the game tends to then crash.

- After you changed the tree.ini to your likings, it might be tempting to just copy it into the next tree's .bin file. If you do this, just make sure the names for the LOD meshes are still correct, otherwise it won't show anything.



This is all I can think of at the moment, if there are any more questions just ask!
Hi mate and thank you for all those precious advise !
I have a few questions if you don't mind.
First what program do you use to edit .bin files externaly please ?

Second, I'm having trouble with LODs spawning and vanishing randomly as I move back and forth from the trees... Do you have any idea about that ? I have set only 2 levels of details using the suffix LOD_0 the detailed models and LOD_1 for thje low res ones. Is there a proper way to organive the scene ine Blender so CSP can figure out who's who in the fbx ?

Thanks per advance !
 
Hi mate and thank you for all those precious advise !
I have a few questions if you don't mind.
First what program do you use to edit .bin files externaly please ?

Second, I'm having trouble with LODs spawning and vanishing randomly as I move back and forth from the trees... Do you have any idea about that ? I have set only 2 levels of details using the suffix LOD_0 the detailed models and LOD_1 for thje low res ones. Is there a proper way to organive the scene ine Blender so CSP can figure out who's who in the fbx ?

Thanks per advance !
Hi again ! I managed to sort it out ! Turned out to be my trees being made of multiple meshes. I joined them and rework the materials and now it works !

However, as you can see on the attached picture, the trees are pretty messed up from not so far away and quite fine from far and close sight... (even with just one full res mesh in the bin file) Any idea how I can fix this ? Is there anyway to setup the LOD management of the trees so it's not that aggressive ??

Thanks !
 

Attachments

  • Capture d'écran 2024-05-16 220519.jpg
    Capture d'écran 2024-05-16 220519.jpg
    494.6 KB · Views: 14
Hey, it's been a while since I worked on 3d trees so I'd need to get into it again, but you can set the distance of the LOD-switch in the .ini file, so either you set it to very far to make it less obvious or you'd need more LODs in-between. Or am I missing the question somehow?
 
Hey, it's been a while since I worked on 3d trees so I'd need to get into it again, but you can set the distance of the LOD-switch in the .ini file, so either you set it to very far to make it less obvious or you'd need more LODs in-between. Or am I missing the question somehow?
Thanks mate !

I don't have set any file.ini related to the trees for now. It's just working on default values but it's a bit aggressive...
Do you have any link explaining how to to set it up please ?

I managed to sort out my messed up trees digging the internet. Turns out Content Manager doesn't like Blender's decimate modifier when making LODs appart in planar mode...

For those who struggle like me, here are useful tips :
 

Latest News

What would be the ideal raceday for you to join our Club Races?

  • Monday

    Votes: 13 12.1%
  • Tuesday

    Votes: 10 9.3%
  • Wednesday

    Votes: 10 9.3%
  • Thursday

    Votes: 12 11.2%
  • Friday

    Votes: 40 37.4%
  • Saturday

    Votes: 61 57.0%
  • Sunday

    Votes: 42 39.3%
Back
Top