Search Unity

Custom tree model not rendering correctly using Unity's Terrain

Discussion in 'World Building' started by yosefstudios, Mar 19, 2022.

  1. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Hi!

    I've recently started using the Terrain Toolbox on my project to see how it's doing. The last time I used it, it was still in preview. Anyway, I decided to instantiate trees via terrain instead of manually placing them in the scene. I'm mixing some prefabs from the latest tech demo Unity put out recently with some custom models I made with a program called TreeIt.

    However, a problem appeared, and it's that the trees that I made with that program are not rendered correctly; the leaves of the trees are invisible. I don't really understand very well what the problem is, I thought maybe it was the shaders, so I tried with the ones that come by default (SpeedTree shaders), and the ones that came in the demo (SpeedTree_URP). It's worth mentioning that I am working on URP.

    I understand that the prefabs in the demo are trees created with SpeedTree, but when I manually place the custom models, they are rendered correctly (the leaves are visible), regardless of the shader I use. As far as I know, Unity terrain should be able to use trees created with any other program, right?

    Another thing I noticed, is a message that the Unity terrain gives me when selecting the custom tree:
    Now, that may be the issue, but those shaders are built-in shaders, so they can't be used with URP.

    Some attachments bellow:

    trees.png

    terrain.png
     
  2. Deleted User

    Deleted User

    Guest

    This is because the treeit models don't have the leaf and the trunk parts joined.... Those are seperate.... u have to export them the model to a 3d modelling software and merge them into single object
     
  3. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Ahhh alright, I didn't know that. I'll try that, thanks!
     
  4. rmib200

    rmib200

    Joined:
    Jan 19, 2017
    Posts:
    7
    Did you find any easier solution?
     
  5. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Unfortunately no. Also, it didn't work, it only works with TreeCreator trees.
     
  6. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,749
    IMHO i always place trees manually, as Unitys terrain placing tools always cause some sort of problem, with different trees. Also manually placing trees you have much more control over them (the ability to move position of the tree and much more), which you cant do with the terrain placement system.

    So as you yourself have found out, manual placing is best...
     
  7. yosefstudios

    yosefstudios

    Joined:
    May 8, 2015
    Posts:
    129
    Yep.

    New terrain tools are actually quite helpful (and definitely an improvement), but they're still optional, they're not integrated yet. I suppose there's a good reason why.
     
    warthos3399 likes this.