Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MTree - Tree creation

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

  1. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Oh okay. Strange issue.
     
  2. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Well, I'm not sure what the issue was, but I deleted all of the trees out of the VSP biome and added them back and it resolved the issue.
     
  3. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    ha, thats a cool but strange solution!
     
  4. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    hey guys, as you all are affected aswell by the global pandemic COVID-19 my support for mtree is atm limited, and takes longer than usual.

    dan
     
  5. riveranb

    riveranb

    Joined:
    Jul 16, 2017
    Posts:
    16
    I am using MTree with HDRP 5.16.1 (Unity 2019.1.10)
    I am curious what settings should be for GPU instancing to work optimally (or correctly)
    I use a simple test scene with one terrain and plant single kind of trees (oak.prefab)

    But when my HDRPRenderPipelineAsset setting enables "SRP Batcher"
    I get stats number of "Batches 2537 Saved by batching -2535" with higher FPS 180+
    upload_2020-3-26_22-41-50.png

    And when disables "SRP Batcher", I get "Batches 380 Saved by batching 2157" with lower FPS 80+
    upload_2020-3-26_22-42-14.png

    It's strange to see stats about "batching", not sure if it is Unity's bug
    What is your suggestion about using SRP Batcher or not?
     
  6. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    745
    Batching and instancing can not work together.

    https://forum.unity.com/threads/srp-batcher-and-gpu-instancing.833362/
     
    riveranb and dan_wipf like this.
  7. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Is there an easy way to add subtle color variations to trees that have been spawned using something like Vegetation Studio? My thinking was that we would need to modify the Mtree leaf shader to apply colors based on world position, but not sure if there is a better way without needing to manually modify the shader.
     
  8. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    You would need to manually modify this, to get a position based color variation.

    at the moment we’re focusing on having a stable core shader and do not add alot new feautures.. but we are workibg on having support for the vegetation engine and a ex dev from procedural worlds is working on a advanced set of shaders. so we can focusing more ob the procedural part of tree generation (more feautures, more realism)
     
    hopeful likes this.
  9. riveranb

    riveranb

    Joined:
    Jul 16, 2017
    Posts:
    16
    Seems like a bug
    In newest MTree 2.3 version, using HDRP 5.16.1 (Unity 2019.1.10)
    Save tree as prefab.
    Use terrain tree brush to edit trees on terrain.
    In game view, shadows are casted incorrectly, but in scene view shadows are fine.
     

    Attached Files:

  10. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    @riveranb well there are no trees in gameview either, can you tell me why?
     
  11. riveranb

    riveranb

    Joined:
    Jul 16, 2017
    Posts:
    16
    In my observation, trees are rendered with incorrect mesh-render-order.
    First all leave meshes then bark meshes are rendered, and all shadows are projected on trees & incorrectly
    I'm not sure what I have done wrong.

    If I place tree prefab in scene heirarchy directly, shadows are all good.
    This only happens when I use terrain tree brush to generate trees on terrain. (and tree prefab saved in HDRP environment)

    https://drive.google.com/open?id=1A7jaIj5nrh53-lSSnyRM1hsWIto0VhKe
    This is the tree prefab I tested with.
     
  12. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    36
    Out of curiosity. Is it possible to get the Outline Shader variants working with LWRP?
    (edit: 2019.2.16f1, LWRP 6.9.2)
    The normal LWRP materials work well enough for my project right now but I'd like to push the visuals toward a more toon~y style in the future.

    That said, amazing asset. One of my favorites to use because as the description says "What Mtree does, it does it well." :)

    Also:
    It seems my materials are a bit out of whack concerning the handling of light in the scene when switching LOD level.
     
    Last edited: Apr 8, 2020
  13. dynamicvoltagegames

    dynamicvoltagegames

    Joined:
    Apr 15, 2019
    Posts:
    22
    The tops of my trees look awful. The leaves look like they're floating and not attached to any branches. Is there any way to taper off the top of a tree so that the leaves stop going outward towards the top?
     
    Last edited: Apr 14, 2020
  14. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    @mherpin

    hi,
    is it possible to modify URP shaders with Amplify shader editor? or update these to newer URP versions?
     
    dan_wipf likes this.
  15. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    it is!
     
  16. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    looks like your wind is not setup. try to add a mtree wind (Window/Mtree/Add Wind) to your scene
     
  17. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    thanks for the hint of lod transition!

    for the toony style, we dont have plans to support it on the srp atm. (another set of shaders, which is to immense to support aswell :/)” ) sorry about that. But you could manipulate the shaders if you have amplify (atm 30$ on sale with the spring sale)
     
  18. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    745
    toon shaders are easy. LWRP has shader graph. You can find a tutorial online about how to make a toon shader with shadergraph.
     
    dan_wipf likes this.
  19. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    745
    I am making my own tree shaders using shadergraph. Lots of stuff I don't need like wind and sss etc.
     
    dan_wipf likes this.
  20. paulindrome

    paulindrome

    Joined:
    Mar 10, 2018
    Posts:
    36
    Understandable. Thank you for following up on that. :)

    Yes. I do own Amplify Shader but I haven't touched it in a long while and don't currently have the time to adjust the shaders to my use case, unfortunately.
     
  21. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    well with ase its pretty easy :) we cleaned up the shaders latley for a nic easy overview! for example you can add to any shader the mtrees wind node, and wind will work with the shaders :)
     
  22. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Can this export to FBX or some other model format?
     
  23. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    No, But Unitys FBX Exporter does the job nicely! Where do you need the Fbx to export to?
     
  24. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Zbrush so I can do some custom modifications to add character.
     
  25. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    generates at runtime?
     
  26. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
  27. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    oh too bad, it would be so nice to see trees grow
     
  28. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    well i guess for the leafs i can imagine you could do growth on a shader based solution
     
  29. shawhu

    shawhu

    Joined:
    Mar 11, 2016
    Posts:
    17
    I've purchased this asset (mtree) a couple months ago and now I'm trying to use it in Unity 2019.3.xxx, the URP version is 7.3.1. Is it possible to use mtree under URP 7.3.1? or should I replace it with 7.1.8?
     
  30. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    1) Similar question, but I'm on 2020.2 Beta and HDRP 9

    2) Also, are there ready made MTREE plant packs available for purchase by anybody? I'm in need of high quality typical european trees like Maple, Oak, Birch (Acer campestre, Alnus glutinosa, Betula pendula, Betula utilis, Malus sylvestris, Pinus nigra, Pinus sylvestris, Prunus avium, Quercus Ilex, Quercus robur, Quercus robur etc). Also rome ready made high quality grass packs, typical field grass (Agrostis castellana, Festuca rubra litoralis, Festuca rubra rubra, Lolium perenne etc)
     
  31. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    hi
    @shawhu Mtree will support in next update SRP 4.10 and 7.4.1all other SRP versions are going to be deprecated and wont be updated any further. The reason is, we are a small team, and cant handle all new srps. so we decided to go with the stable and lts versions of srps

    @newguy123
    1. we do not support alpha and beta builds, and i cant recomend them either for serious production, unless the tech in it is relevant for your project.

    2. Yes there is a guy call Alexander Elert who makes beautiful Assets for the store all with Mtree you can contact him on our discord channel (link in my signature)

    he listens to requests by users as far as i can tell.

    the current package available are eucalyptus forest and a scifi package, a japanes package is under development, and some example trees are as well under development for MT Shaders, which are a set of advanced high end shaders by Dawie (aswell on the discord channel)

    dan
     
    newguy123 likes this.
  32. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Mtree Changelog

    WARNING!
    Upgrade from Mtree 2.3 or older + is not possible, please delete the old Mtree Folder, then install the newest Mtree!
    WARNING!

    Mtree 2.4f0.0 (Beta is running 2.4rc3.0)

    EDITOR
    * Reduced SRP support to 4.10 and 7.4.1
    * Added Double Sideded Geometry for HDRP, necessary for Translucency in HDRP with the Diffusion Profiles!!!
    * Added new Skyboxes (Morning, Midday, Sunset)
    * Added new Buttons to Demos Scene, for nicer Preview of the Trees!
    * Fixed VSP Bark Shaddow issue
    * Raised Compability to Unity 2018.3+
    - Legacy Shader Update (added AO, Thickness Map option), SRP will come with next version
    - Added new Texture Samples
    * Updated HDRP Sample Scene
    * Updated all Shaders to match the new Shader Layout.
    * Fixed Little annoying Bugs.

    Mtree is structured now in:
    => MEnvironment (Holds all Mtree Related Products)
    => MCore (Holds all shared Scripts and Shaders)
    => Mtree (Holds all Mtree Only Stuff)
    => MDocumentation (Holds all Documentation of every MEnvironment Asset)


    Shaders
    * Reworked Shaders, added more Texture Inputs
    * Editor Fixes
    Billboards
    * Baked AO in BB Texture
    * Texturesize (64,128,256,512)
    * Muliple Styles how BB is made (2 Sides (+1 When Topcard) / 4 (+2 When Topcard) Sided.
    * Branch Editor Normal Map correction!

    Mtree 2.3f0.3
    EDITOR
    * Rollback Upgrading Trees to newer Mtree Version.
    * Disabled Groupsaving until propperly fixed
    * Updated internal Mtree Version Number

    SHADER
    * Fixed HDRP 7.1.6, 7.1.8 Cutoff issue

    Mtree 2.3f0.2
    EDITOR
    * Fixed Billboard Creation on small objects.
    * Fixed UI Bug, on Mtree Nodes

    SHADER
    * Fixed Cull Mode on URP Shaders 7.1.6 & 7.1.8

    Mtree 2.3f0.1
    VEGETATION STUDIO PRO
    * Fixed Vegetation Studio Pro Forward integration
    * Moved Vegetation Studio Pro Shaders to a separated Package for older Unity Versions and non VSP licence holder
    * Updated the VSP Shader Options inside VSP.

    EDITOR
    * Removed Warning, that the Trees need to be upgraded before using with the Updated Mtree Version.

    2.3f0.0
    * Fixed Wind directional Issues
    * Fixed flipped UV’s on Bark mesh
    * Fixed floating Leafs and gap between Trunk and Branches
    * Fixed Billboard Z-fighting.
    * Fixed HDRP Billboard creation
    * Fixed Billboard creation. Wind is reset to Zero, to get a static Tree version for rendering.

    * Added HDRP Translucency with Diffusion Profiles
    * Added new Billboard Types (Single Sided, Double Sided, Topcard).
    * Added SRP 7.1.8
    * Added Bezier Mode for Tree Manipulation

    * Reworked all Shaders (Legacy, LWRP, HDRP, URP).
    * Fixed some minor bugs on Demo Scenes

    2.2f1.0
    * Fixed URP shaddow bug.
    * Added SRP 5.7.2, 6.9.1, 7.1.6
    * Added Toon Shaders for MTree (BETA)
    * SRP 7.1.5 is now deprecated, and no longer supported.
    * Changed AO distance behaviour.


    2.2f0.1
    * Fixed HDRP 6.9.2 Material Inspector Issue
    * Added Billboard brightness slider to ajdust the finial Billboard Image

    2.2f0
    Mtree Editor:
    * Undo Functionality
    * Copy Past Function for Tree Functions
    * Enhanced Branch Editor (Normal Maps compatible)
    * Tree Templates replaces Prefabs
    * Instant Ambient Occlusion
    * Procedural Leaf Type
    * More coherent branch placement
    * Global Wind Controller
    * Changed path of Menu Item of MTree from “GameObject/Mtree/Create Tree” to “GameObject/3D Object/Create New Mtree”
    * New Vertex Color Editor for meshes (Grass) Mtree Shaders:
    * Amplify made Shaders(full source files)
    * Overworked Wind System
    * Billboard Wind
    * Full overworked shaders (Subsurface Scattering, Bark Detail, Smoothness, Local Wind)
    * Full SRP support from 2018.3 upwards with latest, confiremd SRP versions (4.10 / 5.16.1 / 6.9.2 / 7.1.5)
    Mtree General:
    * Example scenes Updated with new Trees, auto Setup of the Scene, based on what editor/srp user uses
     
    Last edited: Jul 7, 2020
    wetcircuit and Mark_01 like this.
  33. spiritworld

    spiritworld

    Joined:
    Nov 26, 2014
    Posts:
    29
    Suggestion:

    Make LOD level count adjustable. Currently it's fixed to 4. In my experience 4 is too many and forest looks funky when the LODs change too often when I move around.

    So, I fiddled the code to decrease it to 3 but then comes a new release and of course I want to update :) but also my hack is gone. Yes, I can remove/change the LODs afterwards but would be easier if it was done before "prefabifying".
     
    dan_wipf likes this.
  34. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    you're damn right :D

    i'm going to change that in 2.4 which is still under construction.. there's a bug in Amplify Shader Editor. So i need to wait for a fix.

    What would you say if there's a Editor Preference List? What would be needed as Standard Preference Values?

    for example:
    - LOD Count
    - Billboard Settings
    - ...
     
    Mark_01 likes this.
  35. spiritworld

    spiritworld

    Joined:
    Nov 26, 2014
    Posts:
    29
    That list looks good. I can't think anything else right now. Big thanks for taking in consideration :)
     
    dan_wipf likes this.
  36. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    A quick question: vertexColor.g seems to be used all over places in the shader, it's used to create color variation, to do some wind related masking, and then also changes translucency.

    Is there a quick explanation on how it's determined during generation? In fact I could use an explanation in all 3 vertex color components.

    vertexColor.r seems like height, masking out near ground, with some variations at the point.
    vertexColor.b seems like leaves, masking out all branches and stumps.
    vertexColor.g I honestly have no idea.
     
    atomicjoe likes this.
  37. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Related to this question is I would like to change how they are baked, for example to put thickness on a vertex color channel; changing the shader is easy enough for me. Changing the baking process doesn't seem easy.
     
  38. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437


    (R) Red = main wind

    (G) Green = randomness / leaf variation

    (B) Blue = turbulence
     
    Baldinoboy likes this.
  39. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Thanks @Dawie3565 for answering the channels question.

    RGBA of the vertex channel is allready used by wind and baked ambient occlusion.

    Of course you can replace a channel to thickness, but this will break the other two wind colors..

    so what we did is now having procedural baked thickness on uv4.x channel (with the next update)

    dan
     
  40. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    961
    Thx both for your answers, I ended up figuring them out after asking, and end up writing my own shader to use the vertex color. We store thickness in textures so ignoring thickness is an option.
     
  41. spiritworld

    spiritworld

    Joined:
    Nov 26, 2014
    Posts:
    29
    I noticed version 2.4.0 released today (yeah!) but asset store shows latest release date as Mar 19, 2020? Also when I tried to import it said "nothing to download / everything's up to date" or something.

    So, was the version 1-upped and files not?
     
  42. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi @spiritworld , thank you for your comment. Actually it is a mistake - my newly associate made a small change in the Unity page of the asset, on the description. I can only guess it triggered a new release. Be assured that nothing has changed from the last version !
     
    wetcircuit likes this.
  43. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    Hi there, this looks like an awesome tool. Could the resulting trees work easily with other shaders like Nature Renderer's ones?
     
  44. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi looking to use Mtree for some custom trees in the HDRP render pipeline. I just did a test to see how things work. I'm using 2019.4.11f1. In the test I brought the mtree package into the fontainebleau scene to test how it looks with the bark materials and branches/leaves applied to the tree I created held up with the trees in that scene. With a bit more work I think I could match them.
    But unsure how I would do this with the materials provided by Mtree for the HDRP render pipeline and a little unsure if Mtree offers translucent/sub surface scattering leaves for HDRP?
    Does anybody know of any good tutorials online on how to setup mtree for the HDRP render pipeline in Unity please?
     
    newguy123 likes this.
  45. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi @vlastan , yes of course the resulting trees can be used in another asset: you will be able to use the shaders of Nature Renderer on the Mtree trees and it will work just fine. Of course you will not have the wind or the AO from Mtree shaders. Hope it helps !
     
  46. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi @Toby31 , Mtree offers translucent leaves for HDRP. Here are the steps to setup Mtree for the HDRP pipeline of Unity :
    1. Import Mtree in a HDRP project
    2. Import the latest SRP version (Mtree -> SRP -> srp *** -> HDRP ***)
    Be sure the Mtree shaders of the trees are HDRP. If not:
    3. Manually change the Mtree shaders of the trees with HDRP ones (find them in Mtree -> Shaders -> HDRP -> shaders).
    Following this method you will be able to use Mtree with HDRP. I hope it helps !
     
  47. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    I just bought Mtree and i get these errors when i import the asset in 2019 LTS:

    Assets\Mtree\Scripts\MtreeComponent.cs(345,30): error CS1729: 'Billboard' does not contain a constructor that takes 7 arguments
    Assets\Mtree\Scripts\MtreeComponent.cs(346,14): error CS1061: 'Billboard' does not contain a definition for 'SetupCamera' and no accessible extension method 'SetupCamera' accepting a first argument of type 'Billboard' could be found (are you missing a using directive or an assembly reference?)
    Assets\Mtree\Scripts\MtreeComponent.cs(348,14): error CS1061: 'Billboard' does not contain a definition for 'Render' and no accessible extension method 'Render' accepting a first argument of type 'Billboard' could be found (are you missing a using directive or an assembly reference?)
    Assets\Mtree\Scripts\MtreeComponent.cs(351,35): error CS1061: 'Billboard' does not contain a definition for 'CreateMesh' and no accessible extension method 'CreateMesh' accepting a first argument of type 'Billboard' could be found (are you missing a using directive or an assembly reference?)
    Assets\Mtree\Scripts\MtreeComponent.cs(360,29): error CS1061: 'Billboard' does not contain a definition for 'CreateMaterial' and no accessible extension method 'CreateMaterial' accepting a first argument of type 'Billboard' could be found (are you missing a using directive or an assembly reference?)
     
  48. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    Please could you explain a little better? I get the same errors in a brand new project, but official mtree documentation doesn't say anything particular regarding installation. I just import it from the asset store and get the errors.
     
  49. mherpin

    mherpin

    Joined:
    Oct 1, 2013
    Posts:
    103
    Hi @vlastan , do you use a particular SRP ?
     
  50. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    No, i use standard built in renderer