1
\$\begingroup\$

I'm currently developing a RTS game that has a bird view camera operating while playing the game. One of the core aspects of my game are trees.

So in the previous days i was playing with trees in Unity.

  • First i played with Unity Tree Creator however later i realized it is broken since 2018.3, and devs said it wont be fixed because it will be a community developed package in the future
  • Then i downloaded assets from the store that are said to be highly optimized trees, however they are mostly for "3rd person camera projects" thus having around 7-14k triangles.

After these experiences, i decided to export a tree prefab to fbx, then manually decrease the triangle count to around 2.5k in 3ds max, then reimport it to Unity. With this technique i was able to produce quite good results, but still not very satisfied with it.

My camera view, and my "dense forest" 180-300fps... and only like 3-4 shadows enter image description here For the above picture i used a Tree with 2 LOD and one billboard(BB).

After playing with this i realized i can sure do better especially with playing LOD numbers, material optimization, and with the default tree trinagle optimization.

However the problem is i can't model pine trees that satisfy my needs in 3ds max. So i started looking into SpeedTree documentation, however it seems a bit too professional for my needs(All the tutorials also make trees with like 20k poly/tri).

So regarding this story. I would like to ask the following question + a bonus one about LOD:

  • Can you model quality trees with SpeedTree for Unity that have like around 1k-2k triangles, or SpeedTree is for high quality/high poly trees, they algorythms won't work with lower polygon count etc? (I heared they have a simplify modifier is it good? like make a 7k triangle tree then cut it to 1k-2k)
  • I'm thinking about using 4-5 LOD and a BB for smooth transition. In my picture i use 2 LOD and a BB and sometimes when moving the camera fast, transitions are not as smooth as i want it to be. So i would like to rather have more lower detailed meshes before trasitioning to BB. So does having a 4-5 LOD-s a common practice or any better ides for this?
\$\endgroup\$
  • 1
    \$\begingroup\$ Do not make the trees "static" objects. That will bake them all into the level mesh, and that's a nightmare. Had that problem on a production game once. The golf courses (set of 18 holes) were each 2GB. \$\endgroup\$ – Almo Sep 19 '19 at 18:13
  • 1
    \$\begingroup\$ Was not planning to but thanks for the tip! \$\endgroup\$ – Menyus Sep 19 '19 at 18:22
  • 2
    \$\begingroup\$ Have you looked into octahedral impostors as a way of cutting down on the geometry cost of more distant trees? This is how FortNite manages its foliage from afar and when air-dropping into the map. \$\endgroup\$ – DMGregory Sep 19 '19 at 18:39
1
\$\begingroup\$

I don't know about Speedtree but this might help you:

  • Create a tree in Unity 2018.3 and export it using the Unity FBX Exporter

  • Try the Modular Tree addon for Blender and then export as FBX

    • Trees are also created via nodes
    • Leaf placement was problematic and I encountered a few minor bugs back when I used it
    • Might not yet be stable in the (fairly) new Blender version 2.80 but 2.79 should be fine
    • It's free & open source

Also consider using Blenders Decimate modifier to reduce triangle count of your exported mesh to create LOD's instead of doing it manually (Requires some knowledge of Blender or similar 3D modeling software):

  1. Add a decimate modifier
  2. Play arround with the 3 modes and their values
  3. Fix uv's if the modifier messed them up (But: Automatic uv generation in Blender isn't half as good for organic meshes as it is for architecture so you might have to get your hands dirty anyway and fix uvs by hand)
    1. Apply the decimate modifier
    2. Edit Mode -> Select faces with wrong uvs -> Smart UV Project.
    3. Select all uv's -> Average UV Island Scale
    4. Move new uv islands

Seperate the leafes into it's own mesh object if the decimate modifier only seems to work for either only the leafes or only the tree base (non leafs)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks man, i will definitely look into this! \$\endgroup\$ – Menyus Sep 21 '19 at 7:14
  • \$\begingroup\$ Yout welcome ! Feel free to tell me if you run into problems. Also consider upvoting my answer if it turns out to be what you were looking for (My reputatation is too low to even upvote your question lol) \$\endgroup\$ – Bartimaeus Sep 21 '19 at 9:27
  • \$\begingroup\$ i upvoteed it, and will mark it if it is what i was looking for :) \$\endgroup\$ – Menyus Sep 21 '19 at 9:32
  • \$\begingroup\$ Thank you! I added a short explenation on how to create LOD's in Blender to my answer. Feel free to ask me about if you turn out to give it a try but run into issues (I kept the explanation short since I don't know if this even is what you are looking for or if you use Blender) \$\endgroup\$ – Bartimaeus Sep 21 '19 at 10:09
  • \$\begingroup\$ Thanks for the tips! \$\endgroup\$ – Menyus Sep 21 '19 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.