Giter VIP home page Giter VIP logo

hydraulic-erosion's Introduction

Hydraulic-Erosion

Simulating erosion to try make procedural terrains look a little more natural. See my video on this project here: https://www.youtube.com/watch?v=eaXk97ujbPQ Interactive demo: https://sebastian.itch.io/hydraulic-erosion

To run this project you'll need to open it in the Unity game engine: https://unity3d.com/

Before: Before After 70k iterations of erosion: After

Resources: https://www.firespark.de/resources/downloads/implementation%20of%20a%20methode%20for%20hydraulic%20erosion.pdf http://ranmantaru.com/blog/2011/10/08/water-erosion-on-heightmap-terrain/

hydraulic-erosion's People

Contributors

seblague avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydraulic-erosion's Issues

Possible data racing between droplets

Really nice code and video, but there's one concern to me:

So basically in your GPU implementation each thread controls one water droplet, but what if two droplets descend to the same area at the same time and their erosion/deposition range overlap? Having two threads updating the same pixel at the same time can lead to data incoherence.

I tried the simplest solution by adding atomic operations but it's rather a brute-force approach and the performance is underwhelming, and strange enough the final terrain looks no much different from the original one, maybe the chance of getting overlap is small and it doesn't matter?

There is another erosion model called cell-based erosion that assigns one thread per pixel and tracks the total amount of water content in a cell then divides the content evenly based on the flowing direction. We can use a technique namely virtual pipe to store the content independently for every outflowing direction and sync with one thread per pixel later. Unfotunately in particle erosion it doesn't seem possible. I am really running out of ideas.

How do I use this?

I can't figure out how to run it, so far I've managed to get it running and a mesh generated. How do I get the program to generate terrain that the erosion can be run on, so far it's always flat.

Getting error CS1644: Feature 'interpolated strings' cannot be used.

I'm getting the following error at load. How might I fix this so that I can run the program?

Assets/Editor/MeshEditor.cs(40,28): error CS1644: Feature `interpolated strings' cannot be used because it is not part of the C# 4.0 language specification.

It seems like I'm not using the right C# version or something?

Add more info to README

As it stands right now, I don't know what kind of projects this is. C#? Some kind of framework? How do I run it? Why isn't there a standalone?

question

I'm new to c# and am running from linux using monodevelop. Should there be a project file of some sort here? Sorry for the newb question.

Compute shader thread limit

Is this project still working? I've cloned it to try it out but it's not working due to a thread limit error

Thread group count is above the maximum allowed limit. Maximum allowed thread group count is 65535.

Is there a way to solve this?

Randomize seed missing for GPU height map etc.

Great code, only:

You seem to be missing the line "seed = (randomizeSeed) ? Random.Range( -10000, 10000 ) : seed;" from the GenerateHeightMapGPU function which is in the CPU version, needed to add it to allow randomizing.

The thread count for height generation can be too large for older GFX cards so you have to cut it into chunks - you could test for 64k max maybe rather doing 2048*2048 for example

Also I wonder if the height map gen can be made the same for both GPU & CPU to truly test them side by side as CPU is using basic perlin noise, GPU simplex.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.