Page 1 of 3 123 LastLast
Results 1 to 20 of 42
  1. #1

    Simulating erosion in Blender

    Hi,

    I started working on a script to simulate erosion. The idea is to develop it into a proper addon that can be used together with landscape generating addons like ANT.

    For now it just simulates thermal erosion but the next milestone will be weathering by rainfall to create canyons and gullies, but because it's always better to receive cooments and suggestions before finishing a project :-) I thought it would be a good idea to make available in its current form.

    Details and instructions can be found here. C&C are very wellcome of course.

    cheers
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  2. #2
    Member ejnaren's Avatar
    Join Date
    Nov 2009
    Location
    Denmark
    Posts
    740
    @varkenvarken Nice to see you back How is the back?
    Ever since you very nice tree addon I have been very impressed by all you ideas. This one looks ver y useful as well. When you say it can load a height map do you mean it can generate a mesh from that?



  3. #3
    @ejnaren: thank you, the back's getting better every day :-)
    The script in its current form can read .raw files and heightmaps but that heightmap format is specific for this script, I.e a format that I made up :-) (Currently AFAIK there are no addons that can read DEMs directly but there is I think an addon that can read .img files (produced by NASA for mars and moon maps I believe) and I have seen tutorials to convert DEMs with external programs.

    Anyway the .raw format is basically a list of triangles with the coordinates of the three vertices in plain ascii seperated by spaces.

    The format I devised is even simpler, its just a line stating the number of grid cells in the x and y direction followed by Y lines with a z-value (height) for each cell in the x-direction:
    2 2
    1.0 0.9
    0.9 0.8

    The format was chosen so that it was easy to create a surface graph in Excel :-) It is also quite easy to construct such heightmap by hand and yes then it is posdible to convert it to a .raw file

    Code:
    #just convert
    python erode.py -i -infile handmade.dat -outfile map.raw -ro -I 0
    (just specify zero iterations)



    cheers,

    -- michel.

    ps> it would be very useful if someone could write a import addon that could read .dem files natively ( hint :-)
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  4. #4
    Member
    Join Date
    Mar 2006
    Location
    none
    Posts
    977
    the erosion images look great.ANT was missing erosion to make natural looking features.Bryce has a instant "fake erosion" brush which you can use to paint erosion on needed areas of the heightmap.



  5. #5
    Member
    Join Date
    Jun 2010
    Location
    Melbourne
    Posts
    1,250
    This is another really interesting project! I was playing right in these days with world machine, which I read is the best for this kind of filters. I look forward to see your script! Thanks for all your great work!
    Blender Cycles: Lighting and Rendering Cookbook - http://www.packtpub.com/blender-cycl...-cookbook/book
    ArtStation - https://www.artstation.com/artist/bernardo



  6. #6
    Meanwhile I made a first attempt at simulating ersion by water. Certainly not perfect yet, but already interesting (I think :-)

    Details in this article.

    Next step will be turning this into a proper Blender add-on, not because it is finished yet but because I think experimentation is a lot easier with direct visual feedback instead of with the current workflow of exporting/command line/importing.

    cheers,

    -- Michel.
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  7. #7
    Member m9105826's Avatar
    Join Date
    Dec 2007
    Location
    Fairfax, VA
    Posts
    4,187
    Bring it on! Time to get rid of Vue!
    Long time 3D artist and member of the official Cycles Artists Module
    https://www.youtube.com/user/m9105826 - Training, other stuff. Like and subscribe for more!
    Follow me on Twitter: @mattheimlich or on my blog



  8. #8
    Originally Posted by m9105826 View Post
    Bring it on! Time to get rid of Vue!
    That sounds a bit ambitious but I'll certainly try ;-)
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  9. #9
    Member ejnaren's Avatar
    Join Date
    Nov 2009
    Location
    Denmark
    Posts
    740
    I look forward to creating landscapes with this addon! The water erosion looks very natural to my eye.



  10. #10
    Member m9105826's Avatar
    Join Date
    Dec 2007
    Location
    Fairfax, VA
    Posts
    4,187
    Originally Posted by varkenvarken View Post
    That sounds a bit ambitious but I'll certainly try ;-)
    I like to live in my dream world where I can uninstall most of my other 3D packages
    Long time 3D artist and member of the official Cycles Artists Module
    https://www.youtube.com/user/m9105826 - Training, other stuff. Like and subscribe for more!
    Follow me on Twitter: @mattheimlich or on my blog



  11. #11
    I reworked the code to a proper addon: not terribly interesting yet because as an addon it does just diffusion, but now I have a proper framework in place to add and test the other functionality in a more interactive way.

    Brave souls willing to try can read about it in this article.

    cheers,

    -- Michel.
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  12. #12
    I added the hydraulic erosion to the addon. Details and doc here.

    Let me know what you think of it and if you find a good set of settings for the options, please share your results. The defaults are pretty decent but I am still looking for that 'instant awesome' :-) Even with the limited number of options we have now, the range of possibilities is vast, too vast to explore on my own, so any good finds are welcome.

    cheers,

    -- Michel.
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  13. #13
    On a fair sized grid (1024x1024) and a few repetitions of the basic settings it almost looks decent:

    example001.png
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  14. #14
    version 0.0.2 adds a way to control the distribution of rain with a vertex group and shows some relevant mesh statistics. The addon is now quite usable IMHO so now it's time to experiment and have a closer look at the erosion algorithms.

    cheers,

    -- michel.
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  15. #15
    Great work as usual. Is it be possible to map the water erosion flow to a vertex color layer, in order to use it as a mask/texture? This always gives a nice effect to the terrain material when generating terrain in other programs. Thanks!



  16. #16
    @Superflea: not yet but it's certainly on my list. Of course there are several interpretations of what this means: it is quite simple to add the equilibrium height of the water as a vcol layer but probably what we want also is the transported water volume at each point of the grid (shallow water can flow fast). This is what we calculate in each step to determine where to move water and deposit or erode sediment but it is currently not stored so I have to figure out a way to do that. Doesn't sound too difficult though :-)
    Check out my new add-on, IDMapper, or the other ones on my Blender Market store.
    There you will also find my e-books 'Creating Add-ons for Blender', 'Open Shading Language for Blender' and the new 'Blender Add-on Cookbook'.
    Main blog: http://blenderthings.blogspot.com



  17. #17
    Varkenvarken,

    Thanks a lot for your efforts! It's a big deal to get these simulations in Blender.
    I hope you'll participate in the next GSoC with some similar task (or one of yours that will be WIP if it's not prohibited).



  18. #18
    varkenvarken,

    I'd like to thank you for your efforts with this plugin. I do have a couple of questions I'd like to ask. First, are you still working on this plugin? I think it has the potential to be the de facto tool for adding that natural look to terrains created in blender. My second question is about the settings. It seems that no matter what settings I use, the one thing that eludes me is the ability to create channeling in my erosion. A simple example would be to just create a plane and subdivide it a few times. Pull the middle section of verts down to create a canyon with angled walls. Now what I would like would be for the water from the top of the cliff to channel down into the canyon bed below creating that cut look that a lot of erosion simulators have, something similar to the basic erosion settings in world machine. Is it possible that I am just missing something in the settings or is it not yet possible to properly channel the water flow to create rivers and such?
    I was walking down the fine line between genius and insanity. But as luck would have it, the the line snapped.



  19. #19
    Member Nerk's Avatar
    Join Date
    Sep 2012
    Location
    Australia
    Posts
    79
    Thanks very much for your add on varkenvarken! I used it a little after you first posted it, although I didn't experiment with the settings. I just did a few iterations and it helped with a background mountain I was working on.

    Recently I needed a volcano in the background. I thought I'd come back to this addon and it would help with the lava flows. However, I had the issue that kook refers to - the hydraulic erosion didn't produce the chanelling effect I was after.

    I have a little bit of experience with python, even less with the blender api, and none with numpy, but I thought I'd have a look at the code to see what was going on. The way you've written this is so nice and efficient, it was like reading a text book. Very interesting and informative.

    For others using this add on, I could see why it wan't working how I thought it would. The water is initialized every time you press the refresh button, and the water only travels 1 grid position every interation. So using the default 10 interations, it's like sprinkling water on sand - the water runs a short way and is absorbed, and the effect is a lot like the diffusion.

    Putting the rain to 0.01 and the interations to 1000 gave more like the effect I was expecting, but as the rock is eroded every iteration, its rather unstable, and there are many spikes and problems.

    The add on is such a great start, I thought I might have a go at altering it to work the way I need it too - hope you don't mind! So far it's been going quite well. I'll post some results shortly.
    Last edited by Nerk; 17-Oct-14 at 05:02.



  20. #20
    Member Nerk's Avatar
    Join Date
    Sep 2012
    Location
    Australia
    Posts
    79
    Here's the default 64 division ANT landscape, on which I've used the modified erosion add-on to demonstrate the three erosion types that varkenvarken had implemented, with the changes I've added. I added vertex groups to help me understand what was happening, and like SuperFlea said, once they were there, they look to be very useful for texturing (and are maybe more important that the actual erosion!) Of course, the idea is you mix the three methods together the way you want. In particular, the hydraulic erosion needs the other weathering modes to stop the rivers digging unnatural holes.

    Diffusion - for soft rolling hills:
    (I couldn't think of a useful vertex group)
    Diffuse01.jpg

    Avalanche (or talis slope) - tall mountains
    There are vertex groups for where the material was removed, and for where it ends up.
    Avalanched01.jpg

    Hydraulic (or rivers) - for gullies
    There are many vertex groups as this one is a bit tricky. Although some are similar, I think that's still handy for texturing as it can give subtle variations.
    Hydraulic.jpg

    The biggest change was to iterate the water and sediment levels separately before moving the landscape around. This lets the rivers settle into a pattern, and run from top to bottom.

    However, there are downsides! Varkenvarken went to a lot of trouble to make his algorithms very efficient, and I haven't, so the speed is no doubt slower. It doesn't seem to matter much for small meshes, but I'm sure it will for big meshes. I also haven't bothered with the numexpr at this stage. I just wanted the add on for distant mountains, so I don't think it will worry me much.

    I'll try to tidy up and package the new version of the addon and publish it here shortly if anyone else would like to try. I'm not sure of the etiquette of modifying someone else's work? I'd be more than happy for varkenvarken to carry on with his version! I thought I'd call the modified add on erosionR (R for river) to distinguish it from the original. Does that sound reasonable?



Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •