Search Unity

How to apply unity wind system to trees made outside of unity?

Discussion in 'World Building' started by KennethGames2020, Mar 20, 2020.

  1. KennethGames2020

    KennethGames2020

    Joined:
    Feb 26, 2020
    Posts:
    52
    Blender has a cool addon that makes trees easy to make. Its called the sappling addon. The problem is that the built in wind system and animations for the trees are very slow, and can cause blender to stop responding when in use.

    Is there any way to make wind in unity apply to trees made in blender?
     
  2. Caspor

    Caspor

    Joined:
    Sep 5, 2017
    Posts:
    7
    Trying to figure out the exact same thing. Its disappointing that no replies have been made. As I understand it Bend factor that is the primary option to get the wind zone to work on trees only works on trees that are imported to the terrain tools feature "Paint Trees". When I import trees form an external 3D software (blender also but not using sapling) the bend factor option was greyed out. Once there was one and i set it to "1" but there was still no swaying. I'm trying to use LOD for the trees also using the decimate modifier but when used, the option for bend factor is always greyed out. Lets hope someone replies. I really do not want to rely on Speed Tree to get the trees to work with a bend factor. But this might be the only option.
     
  3. KennethGames2020

    KennethGames2020

    Joined:
    Feb 26, 2020
    Posts:
    52
    I am reading about shaders and LOD but am unsure about how to use them. I am told they can work for this situation if you know what you are doing.
     
  4. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Did you tried using soft occlusion shaders (bark and leaves)? I think these might be the best build in choice for external tools such as Blender unless you write your own shader. Yes, I think bend factor is the one which defines how much trees will swing. Also you would need to configure wind properties. Also with soft occlusion shaders trees are just swinging but branches are not moving in respect to each other as well as trunk (like for SpeedTree models). If you want branches moving individually you probably would need to write a separate shader. You can take a look in my examples on how to configure wind with soft occlusion shader (would be B_FB_SO scene if cloning the repo).
     
  5. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    So, this is indeed possible. I tried yesterday myself and also made a video on how to import Blender Sapling trees to Unity and make them swing in wind:
     
    Caspor likes this.
  6. Caspor

    Caspor

    Joined:
    Sep 5, 2017
    Posts:
    7
    Thats awesome. Many tips in that video! I will watch it properly tomorrow. I am not sure if this will work in HDRP but will try when I wake up. I have subscribed to your channel, thank you very much for this.
     
  7. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Thanks. Just checked, but in HDRP there are no tree shaders. Also in URP there are no other tree shaders than SpeedTree. As a result this way you can use only for Build-In render pipeline.
     
  8. Caspor

    Caspor

    Joined:
    Sep 5, 2017
    Posts:
    7

    Yes unfortunately this is the case. SpeedTree has still not been implemented to HDRP, many people have been waiting a long time now. SpeedTree has given Unity the API, so we are waiting on Unity for this.
     
  9. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    So that's actually the problem itself. If only ST and no other tree shaders will be supported on HDRP, then we will end in a similar situation like it is currently with URP. As a result there would be no out of the box support for importing trees from other modelling software such as Blender.

    In my opinion it should be not just ST but generic shader standard for terrain trees imported from any software just like it is with Soft Occlusion shader in Built-In RP.