Search Unity

MTree - Tree creation

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

  1. sarum

    sarum

    Joined:
    Mar 2, 2014
    Posts:
    212
    you can put it on the store with a link to github in the description .. like this everyone is happy.
    github can be a bit intimidating for beginners.

    thank you for all the work you have been doing on Mtree .. most awesome !! :)
     
    dan_wipf and CaliCoastReplay like this.
  2. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    i’m happy to do it in my free time ;-) i love the asset, so i like doing it ;)

    i thought about something else creating a private group with people wo actualy bought the asset, and upload a modified bersion of mtree
     
    sarum and Willbkool_FPCS like this.
  3. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Quick Update to HDRP 5.16.1

    Main Shaders are working.
    What needs to be done:

    - Brancheditor Shader functionality with HDRP.
    - Billboard Shader

    Anyone interested in LWRP 5.16.1?
    Or other Versions of the HDRP?
     
    Mark_01 likes this.
  4. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    5.7
     
  5. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    HDRP 5.72 for Testing, i'll upload it on Github after i tink it's allright. If you want to test it out and leaf a Feedback, you're very wellcome to!
     

    Attached Files:

  6. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    @polous you can set the cutoff to 0 then you have no leafs
     
  7. vrWiz

    vrWiz

    Joined:
    Nov 5, 2014
    Posts:
    13
    Is the tree is editable in runtime?
     
  8. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    no, you need to use the integrsted build/save option to save the tree as a mesh
     
  9. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Last edited: Aug 6, 2019
  10. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    i’d say officialy no. it supports vegetation studio pro’s instancing system. but i can send you a tree made with mtree, so you can test it, let me know if you want that
     
    CaliCoastReplay likes this.
  11. ron-bohn

    ron-bohn

    Joined:
    Oct 5, 2015
    Posts:
    318
    Hi! I am making some environment assets to sell on the asset store. Can I use trees that I create with mtree in my assets?
     
    CaliCoastReplay likes this.
  12. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    yes you can, but just the baked ones ;), with it’s shader.

    i believe the mtree wind component is ok aswell. But that’s a question for the Developer.
     
    Last edited: Aug 7, 2019
  13. ron-bohn

    ron-bohn

    Joined:
    Oct 5, 2015
    Posts:
    318
    By "baked" do you mean exported to prefab within unity? I assume that any custom scripts or shaders cannot be redistributed. I mainly want to use the meshes to then re-wrap my uv's into custom atlases.

    I hope to check out that bezier add-on you made once I use mtree more. Thanks!
     
  14. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Shaders you can attach, i asked this before (what can i share and what not), because the wind animation of the tree, you’ll need to have the shader of mtree to work properly

    about scripts you do not have permission, have a look at my improvements. they’re all not core modifications, except faster ao but i did compile it (making a dll out of it)
     
  15. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    I just purchased this nice little utility and i want to ask for some small improvements:
    As leaves for me don't seem to attach completely, it would be nice if they had a corrective option for offset in relation to their branch.
    leave_pivot.jpg
    And little more control over randomness via curve would also be helpful.
    Also, if the 'Start' slider for branches and splits was min-max it would allow having multiple branch types on the same base in different regions.

    And something i noticed: when i had randomness set to 0 on the trunk and simplify angle to more than 0 (3 - default) sometimes whole regions on the trunk went invisible (optimized away i guess)
    optimization.jpg
     
    Last edited: Aug 12, 2019
  16. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    hi there!

    well for the leaf offset, be sure that the wind has the same parameters in the material sections!

    as for the curve i did an addon for full support on custom curved tree! it’s available on github: and called Mtree Bezier Addon

    https://github.com/danwipf/MTree-Addons

    if transparency appears on the tree tweek on the settings(it’s kind of a bug)
     
  17. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Yes, i already found your repository earlier, all the features you have there are nice and i'm probably going to use some of them too, thank's for these contributions; but what i mean with curve is an 'AnimationCurve' exposed in the editor as for other properties.
    For the leaf attachment, the 'mtree/leafs' material doesn't have a wind setting exposed; also the attachment is rigid in relation to the branch, so it's unlikely to be a vertex displacement sideeffect (also validatable by eyeballing the unity selection outline effect that doesn't respect custom displacements).
    Looking at a newly generated tree the offset for the leafs this time is in 'x' direction if y means branch root->tip. I guess offsetting the image in the material may work, but it also may clip the content at the edge in UV space. But a leaf-mesh offset could mitigate that (or some other way to set the actual attachment pivot like in treeit (other tree creator) for example).
    And the 'mtree/bark' shader is set up for opaque rendering, so this can't be a transparency issue (again also validatable by viewing the outline effect, or by switching on selection wire too).
     
    Last edited: Aug 12, 2019
  18. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    I also just managed to break the generator

    I created a prefab of the tree, deleted the scene one, instantiated the prefab via dragging (also got a pink there tree as it seems the materials weren't regenerated/created properly), added a split node after a leaf node (i know it doesn't make much sense, but it allowed it), deleted the split node again and got this (and a mesh that doesn't look properly generated):
    orderbreaking.jpg
     
  19. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    i’m not the dev, but i’ll have a look in this about the wind, it happend to me aswell, and in the end i had to adjust it and it was attached as expected, use the provided wind component of mtree
     
  20. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    It's really not related to the wind. It's just an offset in the UV that doesn't match with the mesh attachment. An adjustable offset will fix that.
     
  21. RodatGHG

    RodatGHG

    Joined:
    Jan 23, 2014
    Posts:
    9
    Hi there, This asset looks great & I am on the verge of buying it but had a couple questions :)

    How do the trees scale? Will they break if I scale them a substantial amount in a scene (not during play)? (x 50 for instance)

    Also, is it possible to swap out the leaf textures to represent changing seasons?
    Many thanks for your time!
     
  22. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Lars-Steenhoff and Mark_01 like this.
  23. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Ideally i'd like to see those requests as official improvements (also, mesh-leaf offset, not shader based) so i can use them in every project i import mtree later on (else i could just fix that myself, but that's what i'm trying to avoid as it's the reason i purchased an asset), but thanks for your help.
     
  24. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    well if you scroll back a bit... the dev has temporarly abandoned this asset, and i’m just intrested in having this thing which is in my opinion really awesome alive and updated with community stuff.

    i was in touch with maxime herpin for some time but then he never responded on any channel.
     
  25. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Ouch, i hope that's not actually the case and i purchased an abandonned addon :-/ (not quite cheap compared to other asset store stuff; i was expecting this in turn was worth the support..)
     
  26. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    @Flavelius

    Again for Leaf's wrong offset what I did to reproduce this:
    - Create new Project 2018.3.5f1 and import Mtree
    - Add Birch Example Tree and what a surprise it's there. (Texture: Branch_Serated)
    Branch Serated Tex.png
    Fix:
    - Swaped texture with Palmate Texture => Offset is correct.
    Palmate Tex.png
    Conclusion:
    The Bracht_Serated Texture is off and not correct! So Take the Branch Editor and create your own Branch Textures, which propably in most cases will result in correct Results!
     
  27. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    The first screenshot with offset errors i posted was using a result of the branch editor unfortunately. And still in that case it would be helpful to be able to just adjust the offset instead of possibly taking a loss in quality by re-editing the texture.
     
    dan_wipf likes this.
  28. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    hm default branch editor is anyway only 1024x 512 pixels => you could use my enhanced version, with real normal map support for textures from 512 x 256 up to 4096 x 2048 pixels

     
    wetcircuit likes this.
  29. RodatGHG

    RodatGHG

    Joined:
    Jan 23, 2014
    Posts:
    9
    Thanks for the info! I imported the Unity package but its says the prefab cannot be imported , it may be broken. There also seems to be a missing script that should be attached to the prefab :)
     
  30. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    This is a pretty nice asset.
    One thing I am not sure about is that the leaves disappear at a distance, leaving just the branches and trunk. Which isn't particularly us full. Is there a way to get around this?

    A few thing that would be nice to have is a disable button for each function. Have it so that the "Add Function" button doesn't work with the Leaf function, sense as far as I can tell none of the functions work with it properly.

    Then just a couple small UI/UX thing. I would change the style of the tabs to be "toolbarbutton", to make them more readable that they are tabs, and more consistent with the rest other Unity elements.
    The last small thing is that a few of the names of the variable fields are all lower case. And others only have the first letter capitalized. Where as default Unity components have the first letter of each word capitalized.

    They are pretty easy to do. Took me about 30 minutes to do. But would be nice to have them as default. But I do really love this asset! :)
     
    dan_wipf likes this.
  31. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    RodatGHG likes this.
  32. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    RodatGHG likes this.
  33. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    @dan_wipf In the LODs the leaves should just be getting bigger and fewer. The leaves are actually fading away. Doing a bit more experimenting it seems to happen with other shaders too. But I have no idea how to stop it from doing that or what is causing it. Sort of hard to see, but here is an example of what it looks like.
     
  34. RodatGHG

    RodatGHG

    Joined:
    Jan 23, 2014
    Posts:
    9
    Hi - I tried the import again - as a custom package and still have the same problem. Cannot add the prefab to the scene as prefab may be broken. Also - the missing mono script is Birch GPI. Am using 2017.4.3f1 for this
    Thanks!
     
  35. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    i used a blank project on 2018.3.5f2

    i belive mtree does not support 2017 and below..
     
    RodatGHG likes this.
  36. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
  37. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    have you tried with AA? maybe increase/decrease the cutoff in the shader

    what do you mean with the add button does not work with leafs?
     
  38. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    294
    Ah, it looks like it had to do with the cutoff in the shader. Thank you!.

    I mean that adding a growth, a split, or a branch doesn't really do anything when you add it to a leaf, right? So what is the point in being able to do it? Removing the option to do the things that don't work make for a nicer UX. That's all :)
     
    dan_wipf likes this.
  39. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Instead of adjusting the cutoff you can also enable 'mipmaps preserve coverage' in the texture import settings of your leaves, that should help too.
     
    dan_wipf likes this.
  40. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    Any tutorials anywhere on how to make custom leaves / bark textures? It looks like they are spherically UV mapped, but I can't really tell. Blender would be preferred, but any 3d program works.
     
  41. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    what do you mean by custom textures?
     
  42. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    custom leaf and bark textures. I want to make like cobwebs, hanging moss, etc.. Anyways, On closer inspection it looks like the textures are UV mapped to a single quad, and those quads combined it "Diamonds" and "crosses", .
     
  43. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    you might have a look at my video. i explain how to create custom leaves / objects

     
    Mark_01 and wetcircuit like this.
  44. RodatGHG

    RodatGHG

    Joined:
    Jan 23, 2014
    Posts:
    9
    Hi, I updated to Unity 2018 4.5.f1 and the tree example is working ok. Many thanks for your support :)
     
    CaliCoastReplay and dan_wipf like this.
  45. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Just FYI, if you're using VegetationStudio Pro with Mtree, you have to edit VSProIntegration.cs, line 32 'LODFadeCrossFade' to false.
    I just had a conversation with the VSPro author about a problem related to this and this toggle should not have been enabled/used like that initially.
     
    dan_wipf likes this.
  46. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Another FYI, if you, like me experience random missing triangles, replace lines 135-136 in Splines.cs
    (which is the whole AddTriangle() statement including 'if (gaps > 0)' )
    with this:

    Code (CSharp):
    1. if (gaps > 0) // Fill eventual remaining gap
    2. {
    3.     for (int i = 0; i < gaps; i++)
    4.     {
    5.         AddTriangle(n - lastResolution + resolution + i - 1, n + resolution - 1, n - lastResolution + resolution + i);
    6.     }
    7. }
     
    dan_wipf likes this.
  47. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    very good! thank you
     
  48. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    Ever wanted realistic Ivy on your tree's like IRL? => Hedera makes it happens! https://github.com/radiatoryang/hedera

    But it needs some modification on the Vertex Color Data of the Mesh, aswell on Mtree's Vertex Color (just a small change, almost not noticable but necessary!)

    If anyone is intrested i'll post how it can be achieved =)

    Example picture:
    Tree IVY.PNG

    Vertex Color = Tree IVY Vertex Color.PNG
     
  49. Willbkool_FPCS

    Willbkool_FPCS

    Joined:
    Jun 13, 2018
    Posts:
    169
    Very nice! That looks super realistic.
     
    dan_wipf likes this.
  50. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    yes it’d be super cool to have such trees!
    12F51CA2-970E-49D0-A708-98405D501E2D.jpeg
    hopefully the developer fixes the leaves position :)

    CF9FD31F-FCA2-4CAA-BA4E-A9253E96A8DD.png
     
    StevenPicard likes this.