Search Unity

Erosion Brush - a tool to paint terrain with noise and erosion

Discussion in 'Assets and Asset Store' started by Wright, Jan 10, 2015.

  1. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    A brush tool for creating erosion. It generates an effect of realistic hydraulic action, weathering and sediment under your mouse cursor, setting both heights and terrain textures.

    This script is targeted not to make the terrain of your dreams in one click, but to provide the artist with a handy and useful tool. It gives an artist the ability to modify terrain to make it realistically eroded in the places where it is really needed to, leaving all the others untouched. Terrain is edited in Unity without using third-party standalone toolkit; not before creating a location, but while working on it - all this gives the level artist a chance to create amazingly looking scene in a very efficient way.


    Links:
     
    Last edited: Jan 13, 2015
    Fibonaccov likes this.
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    This looks completely brilliant, but assuming it's not yet present, would you e able to add the feature to create maps from elements of the edit? World machine is an amazing terrain tool but much because of its map generation along with its erosion features, being able to get sediment/erosion/flow etc maps would make it perfect for use with RTP's coverage generation
     
  3. Spyderworxs

    Spyderworxs

    Joined:
    Aug 21, 2012
    Posts:
    31
    Wow, this looks great, nice work.
     
  4. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    lazygunn, It can paint terrain's splat maps. Splats could be extracted by
    Code (CSharp):
    1. terrain.terrainData.GetAlphamaps(0, 0, terrain.terrainData.alphamapWidth, terrain.terrainData.alphamapHeight);
    and then could be used for any purpose, including converting to textures. Implementing painting directly on textures should not be hard (it is more convenient than splats, actually) and I can do it in next version.
    Spyderworxs, thanks!
     
  5. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    The maps i mentioned relate directly to the contribution of each part of the erosion seperately, so you end up with a map for the sediment/deposition element, the flow element and wear elements individually, which can then be used in rtp's coverage section to drive different layers each. Maybe you could even extract further aspects of your effect to provide quite a variety of different coverage maps that are combined into splats (if you want to remove the use of any external programs, being able to output some general features of the terrain like slope, texture coverage your tool adds and so on). Would make it a pretty definitive tool for RTP use (and imo RTP provides pretty definitive shading for terrain, compared to any competition including from unity themselves). I'm assuming the getalphamaps function doesn't have this information? Unless your tool is automatically generating these maps and inserting them as seperate splats into the terrain data?

    If this feature turns up in the next version, and i think it shouldn't be too hard as you are generating it already, i would think it a silly thing not to aquire if one worked with terrain in Unity
     
  6. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    That's right, Erosion Brush generates erosion map (the amount of bedrock taken from terrain) and sediment map (amount of taken bedrock that is dropped down to the land land down the slope) and inserts them as a splats to terrain splatmap (alphamap).
     
  7. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    ohh i see, well then! thats pretty great, ill id suggest were more maps for different aspects (ive always found the more choice the better here, my wm outputs are usually numerous) but this seems a great tool, i'll be looking out for it when i can get it
     
  8. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
  9. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    BTW, the simulation and speed look really good.

    On the algorithm, it looks like maybe a gravity force could be applied to keep the peaks from 'growing' as they erode? I think that would add a slight rounding to the extra-peaky peaks?

    Edit: Maybe that's what uplift is for. And I was watching the noise section and not the erosion section of the video, so you can completely disregard that I'm sure. :)
     
    Last edited: Jan 12, 2015
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    OMG. Instant buy.
     
    DesertRaven likes this.
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    jason.fisher, if Surface Waters behave as I think (gathers rainfall on all the terrain and sending water down the slope, equalizing dents along the way) than two plugins should work separately without any problems - firstly erosion is painted (or applied to all map), then water flows the beaten track, flowing down in the trenches caused by erosion.
    gecko, thanks!
    BTW I would be grateful if someone who bought plugin would write a feedback in Asset Store.
     
  12. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I've started an Erosion Brush feedback form on Idea Informer. Please feel free to post your ideas or suggestions and if other users vote for it, this will help to create feature list and determine the priorities of the features. Bug reports could be made here too.
     
  13. Iguanapl

    Iguanapl

    Joined:
    Mar 11, 2014
    Posts:
    23
    Great work. A lot of potential in it.
     
  14. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    thanks! such a feedbacks inspire me on further plugin improvement )
     
  15. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I am pleased to inform that the new version is available on Asset Store. It has interface minor bug fixes, warnings removed, tooltips added.
     
  16. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    @Wright
    Hey, I asked Tom about his RTP asset with your tool and asked him if the two could play nice and his response was this:
     
  17. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    That's right. It is a standard terrain. Actually, I'd like to try myself - after the weekend I'll find out for sure if RTP and EB are compatible.
     
    DesertRaven likes this.
  18. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    I sure hope so, I bought EB... And I think it's a fabulous tool.
     
  19. Iguanapl

    Iguanapl

    Joined:
    Mar 11, 2014
    Posts:
    23
    What about adding a simple voxel-based terrain tool that allows you to make cliffs and rocky arches? Something like EB + primitive version of Voxeland
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Licarell, thanks!
    Iguanapl, unfortunately it is not possible to create arches with standard terrain. It's not the matter of editing tool, but the limitation of terrain algorithm itself - it uses simple scalar displacement, not the vector displace. This means that you cannot move vertex aside, only up or down.
    I'm going to add EB to Voxeland - actually, it is already here as it uses Voxeland's land generation algorithms, but not in a brush form.
     
    AaronC likes this.
  21. Iguanapl

    Iguanapl

    Joined:
    Mar 11, 2014
    Posts:
    23
    I know limitations of standard Unity terrain.
    What I meant was a tool-brush that allows you to build voxel-based rocks that could be a great addition to standard terrain.
     
  22. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    There should be a voxel engine in such a plugin, so this goes far beyond of the scope of EB functionality... Really, voxel terrain engine could not be simple - at least the amount of addition will greatly overshadow the essence of the plugin :)
     
  23. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Is it possible to use another package to create stitching terrains edited by the erosion tool?
     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    EB should give no errors when working with such a terrain, and it will paint erosion on one of them - but only one. It will not paint both terrains on seams, for instance.
     
  25. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    Hi, how were your tests with RTP?
     
  26. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Tested the Erosion Brush on a four terrain setup in Terrain Composer, I put an instance of EB on each of two of the terrains for testing. I can paint on each of the terrains separately and stitch them. If I use the same textures and brush setting I can paint on each terrain and cover the texture seems.
     
  27. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    siblingrivalry, I could paint both with height and textures on RTP v3.2 terrain example scene.

    Don Gray, glad to hear that. I'll think about storing EB settings in static variables to make them shared for all script instances. Or try to find other way of sharing.
     
  28. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Great, think it will make it easier to use on multiple terrains.
    A little movie I made showing seams being painted out.

     
  29. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    This looks absolutely incredible!
    I guess it would be possible to use this during runtime as well in some kind of level editor?
     
  30. Iguanapl

    Iguanapl

    Joined:
    Mar 11, 2014
    Posts:
    23
    Looks great. Works even better :)
     
  31. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    thanks. Painting with a brush uses editor features such as handles. But you can call generator functions and pass them arrays of heights in playmode. This will require some scripting though.
     
  32. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Cool, scripting is nothing im afraid of : p
    Thanx for a quick answer!
     
  33. Marked

    Marked

    Joined:
    Feb 24, 2015
    Posts:
    32
    Best ! First of all great job on this amazing time saving tool ! It's works very well till it randomly crashes.
    Do you know anything to fix it ?
     
    Last edited: Feb 24, 2015
  34. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
  35. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    HI,
    Tried this email address mail@denispahunov.ru some time ago and just tested again today,
    it always comes back as undeliverable.
     
  36. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I still can get letters on that mail (including log from Marked). My skype is akaWraith.
    For now I can say that EB does not work on Unity 5 - it constantly spawns an error trying to find standard unity terrain, and that can make unity crash. I'm working on Unity 5 version of the plugin now.
     
  37. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Cool, thanks!
    Not sure why my mail is deliverable.
     
  38. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    New ErosionBrush version which is fully compatible with Unity 5 is ready, and is on moderation now. It will be available on asset Store in a couple of days.
     
    Marked and Don-Gray like this.
  39. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Unity 5 compatible version is now available on Asset Store (v1.10).
     
  40. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    Hi. Why when i builds my project the compiler has errors:
    "Error building Player because scripts had compiler errors". The Errors with the Erosion Brush.

    Copy errors:
    1) Assets/ErosionBrush/ErosionBrush.cs(59,47): error CS0103: The name `UnityEditor' does not exist in the current context
    2) Assets/ErosionBrush/ErosionBrush.cs(71,25): error CS0103: The name `UnityEditorInternal' does not exist in the current context
    3) Assets/ErosionBrush/ErosionBrush.cs(81,73): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?
    4) Assets/ErosionBrush/ErosionBrush.cs(81,54): error CS1502: The best overloaded method match for `System.Reflection.Assembly.GetAssembly(System.Type)' has some invalid arguments
    5) Assets/ErosionBrush/ErosionBrush.cs(81,54): error CS1503: Argument `#1' cannot convert `object' expression to type `System.Type'
    6) Assets/ErosionBrush/ErosionBrush.cs(98,33): error CS0103: The name `UnityEditorInternal' does not exist in the current context
    7) Assets/ErosionBrush/ErosionBrush.cs(121,17): error CS0103: The name `UnityEditor' does not exist in the current context
    8) Assets/ErosionBrush/ErosionBrush.cs(122,17): error CS0103: The name `UnityEditor' does not exist in the current context

    If i delete Erosion Brush from my project - build compile normally.

    With Best Regards, Leonid.
     
  41. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Thanks for your bug report, Leonid. This bug was fixed, new version is on Unity moderation now. I guess that build error is quite urgent for many users, so I'd like to publish a quick fix.
     
  42. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @Wright

    Thanks for a quick reply. How i can write about bugs? Mail? or another.... tell me please ;) Maybe report about bug in public is not good solution )))
     
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Leonid, for all bugs and problems with EB (and any other of my plugins) feel free to email me at mail@denispahunov.ru. This address is stated in "About" section in EB for your convenience.

    This email should work fine, I can receive letters at this email, don't be confused by a post somewhere above. But keep in mind that my spam filter does not allow Cyrillic letters in header.
     
    Last edited: Mar 17, 2015
  44. Autarkis

    Autarkis

    Joined:
    Oct 10, 2011
    Posts:
    318
    Hi Wright,
    I sent you an email today about crashes/freeze up of the editor in u5, and when i was checking the timestamp of the scripts inside the package i download from the asset store they all dated from january. Not sure why that's happening, but i'm stuck at the moment with terrain creation since your script is a big part of my workflow. Just checking if you got it or not, saw this one post where someones email didnt go through. Great product btw!
     
  45. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    I've got your email and replied. My mailbox is ok, it was checked several times ) Please make sure you download EB from Unity 5.
     
  46. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    When you make update? Erosion brush is not work correctly!
     
  47. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Leonid, what do you mean by saying "is not work correctly"?

    If you are talking about this bug:
    it was fixed in the last, Unity 5 compatible version. To get this version please make sure that you downloading it from Unity 5 Asset Store.

    And if you mean that heightmap and aplhamap resolution should match to draw with textures - it is not unpredictable behavior. I'm going to get rid of this limitation in next version, but currently it's ETA is unknown. If this is critical for you please send me your order no., I will ask Unity for refund.
     
    Last edited: Apr 22, 2015
  48. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    Yes, about this. I dont need to refund, i want to repair texture painter when splatmap is 2k and heightmap 4k. I don't talk about that your asset is bad. I asked about update, because i don't known when you fix this problem.

    With Best Regards, Leonid.
     
  49. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    Morfeuskiev, I'd like to inform that I'm working on resolution limitation removing, and work is almost done. I plan to submit new version this week, but it will take about five working days for Unity to review it.
     
  50. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    2,277
    New Erosion Brush version is on Asset Store. Now EB can paint terrain using any splatmap or heightmap resolution. Moreover, it got downscale feature to increase painting speed at the expense of smoothing small detail.

    PS and check out the Erosion Brush facebook page, where additional information, announcements, polls and tutorials could be found. For example - a new full-scale tutorial of creating this terrain from scratch using EB:
     
    Marked likes this.