Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

MTree - Tree creation

Discussion in 'Assets and Asset Store' started by mherpin, Aug 31, 2018.

  1. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    560
    HDRP MTree is not baking billboards properly. I can't imagine how others have not noticed this, except perhaps because they are baking the billboards close to the lighting conditions they have... for the scene they baked in.... or perhaps because billbaords are not seen much intheir games, but in a top down game they dominate, and with a bright spot in the middle... of every tree when seeing hundreds at once ...its very noticable. Notice also how the left ones are brighter than the right ones. When rotated, this also causes weirdness in the way the forest looks, and causes color problems as well.

    Those roots really tie the tree together. Look awesome.

    EDIT: After lots of experimenting and changing of the billboard camera, (including putting in my own local volume and directional light rotated to face down on top of the tree instead of from the side) I finally got satisfactory billboards.

    EDIT II: I ended up not needing billboards of any real detail. Instead I modeled out low poly tree models, and the amount of savings in Tris, combined with the GPUInstancer Asset store asset, made it so I could have a map full of thousands of tree models, about 800 tris each, at about the cost of only 20 fps at most.
     
    Last edited: Feb 27, 2021
    mherpin likes this.
  2. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    560
    As well as the bright spots in the trees I mentioned in Discord many, many months ago, exporting to 4 LODs + 1 billboard is an unecessary noob trap. Jason Booth wrote an essay about it that I posted to the Mtree Discord, which explains why "Moar LODS!!" is not the answer to problems like popping, and often make the problems worse, because it creates more transitions, and because the difference in verts is not big enough from LOD to LOD to justify the constant LOD swap costs. It would be really nice if we could limit how many LOD's we want to export. I only need two models and a billboard, so that means I have to cull and rename everything for every tree I make.
     
    ron-bohn and mherpin like this.
  3. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    560
    When a trunk is given a height offset, and you bake out the MTree to prefab, the billboard sets its pivot point at local-y-0, but the pivot points for the rest of the LODs are at local-y-0 +heightOffest , making the billboard taller by the amount of the height offset.
     
    Last edited: Feb 27, 2021
    mherpin likes this.
  4. leslviv

    leslviv

    Joined:
    Jun 22, 2019
    Posts:
    32
    After adding Mtree Asset to 2021b7 URP project:
    upload_2021-3-3_16-35-19.png
    We have switched from ppv2 to native URP post processing a while ago. ppv2 is discontinued.
    I think everything works if to remove ExampleSceneManager so far. Will update if anything else. Just wanted to let you know.
     
    Last edited: Mar 4, 2021
    mherpin likes this.
  5. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103

    Hi there, thank you for your comments on this, we are currently refactoring the LOD system and will we be sure to remember this! Have a great day :)
     
  6. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    That is very appreciated, thank you !
     
  7. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    186
    are you able to make a low poly stylized tree with it?
     
    3uhox and mherpin like this.
  8. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi there, yes of course you can control the level of poly you want in your tree when you are creating it. As for the style, you can personalize your tree (its leaves for example) so it matches what you have in mind.

    For instance you should theoretically be able to do a tree close to the image below using custom leaves that are shaped like spheres.
    upload_2021-3-15_13-44-57.png

    If needed don't hesitate to ask the community (here or on Discord) if anyone already did these kind of trees ! :)
    Have a great day
     
    wetcircuit and ledshok like this.
  9. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,499
    Hi @mherpin,

    Am a user of Unity MTree but have a question about Blender MTree. Sorry for posting that here but have messaged here before so figure I might as well. Is there is a way in Blender 2.8+ to load in leaf collections instead of just a single object. This way have more variation? Thinking of using 2 tree parameter nodes to add the main leaves and then the smaller leaves to extremities only. Figured I would ask though.

    Edit- Figured out it is using the particle system and the settings can be changed to using a collection in the particle settings.
     
    Last edited: Mar 21, 2021
  10. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    609
    Hello,

    Will this (a) work properly with HDRP 2020LTS and (b) allow use of wind out-of-the-box, or are there any issues to know about?
     
    Last edited: Apr 27, 2021
  11. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    609
    Is this product dead, or are you around?
     
    dan_wipf likes this.
  12. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi there, I believe I have answered by email - sorry for the delay, this is unusual.
    Here the answer for everyone else :

    Yes. I have just released Mtree 2.5.1 : there is full compatibility with all versions of Unity HDRP pipelines (as of today).
    For Unity HDRP 2020LTS, you will need to use Mtree SRP called "HDRP 11+".

    In any case the wind is always out of the box, you'll just need to create an empty object and add the Mtree Wind to a scene.

    It will work right away.
     
  13. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Again, my apologies for the delay. Mtree is still active, I am working on bug fixes, new features and updates for new Unity pipeline versions.
     
    capgeti, Mark_01, ledshok and 5 others like this.
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,692
    Don't forget the folks (like me) that still use the built-in render pipeline! (because it's just better)
     
  15. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    No worries! Mtree is developed on the built-in render pipeline so it will always be compatible for it :)
     
  16. marlukasz1992

    marlukasz1992

    Joined:
    May 26, 2021
    Posts:
    2
    Hello,
    I have a strange problem when using Mtree component inspector window. Every time I'm changing any value on functions like "Branch" or "Leaves" it keeps switching to the "Trunk" function.

    Have you guys encountered that kind of problem before? Is there any solution for it?



    Unity: 2020.2.2f1
    HDRP: 10.2.2
     
    victorkin11 and Duffer123 like this.
  17. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103

    Hi there, I believe you had this issue with Mtree 2.5.1. I have made a hot fix with Mtree 2.5.2 that is available now and is going to fix this. Tell me if you get other issues! Thanks
     
  18. marlukasz1992

    marlukasz1992

    Joined:
    May 26, 2021
    Posts:
    2
    Thanks for the response!

    Unfortunately I was testing in on the recent version. (2.5.2 from yesterday)
     
  19. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi, I've just tested with 2020.2 (last version is using HDRP 10.3) and it seems to work, I would advise to re-import Mtree, and test again if possible! In the meantime I'll do further tests (with HDRP 10.2 specifically), you can keep me up to date :) thanks
     
  20. capgeti

    capgeti

    Joined:
    Mar 5, 2017
    Posts:
    1
    Hello mherpin,

    I'am using MTree version 2.5.2 with Unity 2021.1.11f1 in an URP-Project on Windows 10.
    The leafshader is flickering on a specific distance. It's hard to descripe, so I hope this GIF will help.

    mtree_shader_problem.gif
    https://capgeti.de/mtree_shader_problem.gif

    Steps to reproduce:
    - Start a new URP Project
    - Import MTree Asset v2.5.2
    - Open example scene
    - Import Assets/MTree/SRP/SRP 10.5+/URP 10.5+.unitypackage

    This behaviour does not appears on HDRP.

    Can you help please?

    best regards, Michael
     
    Last edited: Jun 15, 2021
  21. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi there, as answered on Discord I don't have a solution for now but I will keep investigating. Thanks for your comment!
     
  22. SKNKanimation

    SKNKanimation

    Joined:
    Feb 24, 2017
    Posts:
    12
    Logged in just to say that MTree is freaking rad. I spent days hating on various trees in how they ran on the Quest. Thanks to MTree and the easy-to-edit shaders and options, I can get 72FPS in a forest with plenty of headroom for gameplay on Quest 1. So cool. Thanks for making this.
     
  23. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    So glad to hear! Thank you for the support :)
     
    Ne0mega and Mark_01 like this.
  24. lukem123

    lukem123

    Joined:
    Oct 30, 2019
    Posts:
    5


    Ne0mega could you share what you had to do to get the billboards to work? For me in HDRP if I use my default directional light the billboards come out white / gray. If I use the mTree example scene lighting and remove my default scene the billboard seems to come out okay for the example trees, but not for any custom trees I build (they still come out white). Even for the example tree billboards though, the lighting is noticeably off, much darker than the other LOD models to the point it is unusable. It also seems to take lighting on some sides but not the other and I'd really like it to be uniformly lit.
     
  25. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    560
    I have not gotten top card trees / billboards to work correctly. I am using GPUInstancer, (in HDRP) which, IIRC needs a special billboard asset, and if that is the case, I am considering just making and baking my own custom billboards, perhaps even making a custom topcard/billboard generator for MTree.

    I think the top card trees are meant to turn to meet the camera like billboards, hence, when they are static, the normals are facing 90 degrees off, so the lighting comes out wrong.

    My game is a grand strategy, top down, and interestingly, the weird normal thing helps make the forests stand out better from a distance, by giving them "volume" with the weird lighting.
     
  26. ZBufferArrow

    ZBufferArrow

    Joined:
    Nov 24, 2019
    Posts:
    2
    Hello
    i use mtree and it works fine.
    I would like to have leaves with and without fruits that is to set more materials,
    and be able to collect 3D fruit, or cut down trees with a saw or ax.
     
  27. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    90
    mtree.png mtree2.png
    I just bought the awesome mtree plugin, for my first run, the trees looks like overexposure, i even make the evironment color to black. The leaf become white even there is very low light.
    I'm using Unity 2021.1.13f1c1, URP 11.0.1. I imported MTree\SRP\SRP 10.5+ package. Any tips? Thanks!
     
  28. nubbyninja

    nubbyninja

    Joined:
    May 16, 2019
    Posts:
    7
    Wow that actually looks pretty good. I can't get MTree to "save as prefab" at all. Creates only the LOD4 but even that is broken.
     
  29. johnmeyer

    johnmeyer

    Joined:
    Oct 17, 2016
    Posts:
    4
    Anyone got any cool or new Templates they wish to share?
     
  30. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    \MTree\Resources
    Is it possible to delete the folder or rename it to something other than Resources?
    All the files are read during the build process, which leads to a decrease in the startup time of the application.
    The folder size is 6MB, which makes it a bit heavy for launching iOS apps.
     
    atomicjoe likes this.
  31. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    310
    you're save to delete it for build.
     
  32. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,692
    Shouldn't this folder be inside an Editor folder if it's not intended for runtime access on builds?
    That would prevent it from being unnecessarily included in builds.
    From the Unity Docs:
     
    dan_wipf and joeee19 like this.
  33. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    60
    Hello. I got this asset and so far it's pretty all right (beats TreeIt in some regards), but I do have some questions.
    The main question is about restrictive ShareAlike license. Did I get it right, that if I use the shaders and the wind code, I will have to distribute my whole project with the same license, which makes it impossible for commercial use, because I can't share other assets that I got from AssetStore? Why is that?

    I love the way the trees move by the wind, if I really can't use these shaders, is it possible for me see the vertex colours of the mesh, so I could write my own shader for wind sway and such? Is a simple .fbx exporting (which preserves the vertex colours) planned?

    Updated:
    Ok, so there's this in the documentation:
    So, it looks like the restrictive license is only for the trees which one can make with that asset and try to sell them separately, right?
     
    Last edited: Dec 16, 2021
  34. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    310
    Only the files which are licenced under the sharealike licence need to be in your case in the same licence. So you can distribute your asset licenced as you want, but beed to attach the licence file aswell for the mtree stuff you will include (shader, scripts)
     
    my_little_kafka likes this.
  35. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    60
    So, if I'm making a commercial game, I just need to include the share alike license for the shaders, and that's it? Will I be forced to share the changes if I will ever make ones to fit in my project?
     
  36. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    310
    I would recomend to read here what you can an what not.

    https://creativecommons.org/licenses/by-sa/4.0/
     
  37. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,436
    Hello,

    I just recently purchased Mtree from the asset store. When I first imported it into my project I get a few scripting errors. Here is a picture of the errors I am getting:
    Mtree_AssetError1.png

    It basically has to do with the Billboards code section in the Mtree component script.

    I am using HDRP version 8.1.0 and Unity 2020.1.0b10.

    Let me know if you need any more information. Thanks.
     
  38. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    60
    I have fully read the documentation and it looks like this licensing is only for people who are distributing trees they made with the software, making trees for your own game don't get restricted by any additional license.

    I really liked the resulting trees, so far, but the tool is very raw and has some bugs. When trying to bake a tree, it sometimes gives an error:

    upload_2021-12-22_17-22-7.png

    Usually it helps to create an empty scene and export from it (building models from the examples scene sometimes works, sometimes not, and I can't pinpoint why).

    I can solve these problems with some tinkering, but what I can't fix is the high brightness of the foliage on the newest URP pipeline (setting the colour space to Linear doesn't help), I know that this issue is mentioned there by the author, so I want to know — is there an estimate on when this will be fixed?
     
  39. ODINKONG

    ODINKONG

    Joined:
    Nov 4, 2014
    Posts:
    111
    I will second this same error message. I can only bake a tree in a completely empty scene, and it never works for me in the example scene either.
     
  40. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    60
    Is it possible to make the top branches more thick, or at least prevent leaves from spawning on the thin branches (like pruning in TreeIt)? I thought it wouldn't be visible from the ground area, but it's really easy to look up and see some flying branch with leaves, the wire thin branches don't look that good.

    I tried the shape curves, but they don't give enough control over the thickness, and even if I manage to make the tips of the branches bigger, there's holes in the meshes where the tips are.



     
  41. Strogman

    Strogman

    Joined:
    May 6, 2020
    Posts:
    4
    We worked around it until we installed a newer mtree version, and it seems to work better now.
     
  42. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,747
    I have used the Unity Tree Creator before. I am very experienced in making trees with it
    photo_2022-02-21_01-13-59.jpg photo_2022-02-21_01-14-02.jpg

    Yesterday, to make a tree, I wanted to compare MTree and Tree Creator:

    Unity Tree Creator review:
    - Unity tree creator has a bit more options (multiple trunks, more curves) to create grass
    - Unity Tree Creator is very slow and needs always to wait for progressing
    - Unity Tree Creator has no control on the shaders and textures
    - Unity Tree Creator's generated texture is too old and small 1024x1024 in size
    - Unity Tree Creator has very bad control on the leaf creation and a good control on the branch creation
    - FBX Exporter can not export Tree Creator models !!!

    MTree review:
    - MTree is very fast (realtime creation)
    - MTree has a lot more options for optimizing and Quality controlling
    - MTree has better wind shader
    - MTree has collision mode
    - FBX Exporter can export MTree models !!!
    My results using MTREE and built-in pipeline standard shader:
    1.jpg 5.jpg
    6.jpg

    Tips:
    1. The most important in creating a realistic or beautiful tree, is the leaf texture
    2. You don't need any complex shader. The standard shader is the best for all pipelines



     
    Last edited: Feb 20, 2022
  43. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,747
    A very easy solution to fix the white borders from the leaf textures (specially on distance):
    This problem only happens when your leaf texture's border is a bit white when you make it transparent... Not happens on every leaf texture
    Untitled.jpg
    Untitled2.jpg

     
    Last edited: Feb 22, 2022
  44. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,747
    1.jpg
    2.jpg
    3.jpg
    4.jpg
    5.jpg






     
    Last edited: Feb 22, 2022
    StevenPicard likes this.
  45. S1lencely

    S1lencely

    Joined:
    Jan 2, 2019
    Posts:
    1
    I want to figure out that why did Mtree do Step1.2.4.5?↓
    upload_2022-2-23_15-21-59.png

    When I try to "Save as prefab", the billboard will go wrong↓
    upload_2022-2-23_15-25-4.jpeg
    But if I removed Step2.4,then I "Save as prefab" ,the billboard will looks like "correctly"↓
    upload_2022-2-23_15-27-52.jpeg
    however , I am not sure whether THIS RESULT is ACTUALLY RIGHT or not??

    Is there anyone met the problem like this before?
    I tried to find a similiar experience like me, but I failed with a bit sadness~
    I'm waiting for the FINAL REASON here, thanks a lot!
    (and, sorry for my BAD english grammar :p)

    My workspace's details:
    System:Windows 10.0.19043.1526
    Unity Editor:2021.2.0f1c1
    HDRP:12.1.0
    Mtree:2.5.3
     
  46. Gibbonuk

    Gibbonuk

    Joined:
    Dec 10, 2013
    Posts:
    175
    Hi, I was just wondering before I purchased this if there are any trees available to test in a project which include the latest shaders?

    I found one from this thread on the Github page but its a few years old.
     
  47. A_World_Maker

    A_World_Maker

    Joined:
    Apr 21, 2018
    Posts:
    196
    Hi,
    Been a while, thought I would update the app and try it out, see how far it has come.
    First thing I noticed is the documentation, it seems to have lagged behind the advances in the Editor and Inspector functionality/looks. Not by a lot, but it takes a while to establish a workflow.
    Next, I do not know why, but whilst there are Standard and HDRP shaders, there are no URP shaders.
    I setup the 'save prefab' folder, when I clicked save, I got a mesh LOD4 and a texture. The prefab when I pulled it into the scene was invisible and despite being only a few feet away, it said Culled. Adjusting the LODs made no difference, checked the materials and I'd already converted them to URP format, so it wasn't that.
    I could not see how to bake AO into the meshes.

    What I need to achieve is:
    Use URP shaders as standard.
    Output a model that I can then sell in the Asset Store and other engines. Preferably in FBX format where materials are embedded.
    Use the Output models with standard wind in engines (mainly Unity and Unreal).
    Have auto LODs and Collisions.
    Being able to create/use/save my own templates.

    I use several other Fauna producing programmes and have a wide selection but I wanted to try using MTree for its potential without having to resort to using more third party addons to get AO baking, Wind, LODs and mesh combining so they can be used with terrain painting.
     
  48. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    142
    upload_2022-4-28_16-4-21.png
    IS there a solution for this overexposition problem ? URP
     
  49. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    376
    Hi,

    Thank you for this great asset.
    I have created some trees and added them to vegetation studio pro biomes and they seem to be working fine.
    It's working fine as long as it's set to instanced, however, I can't change to instanced indirect which I think should have better performance.
    Is there a shader that supports VS Pro instanced indirect for mtree generated prefabs?
     
  50. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,215
    This is awesome. I was just in an unrelated thread and someone showed me MTree, which looks absolutely amazing.

    Will I be able to use my own custom shaders for this? I use Amplify and I want my materials to be congruent and match in quality. And I hope you extend this to make things like flowers and other flora.

    I'm on Unity 2021.2.8 and working with HDRP. It's gonna be awesome to use transmission on the leaves