Giter Club home page Giter Club logo

erodr's Introduction

Erodr

Erodr is an implementation of Hans Theobald Beyer's algorithm for simulated hydraulic erosion of landscapes. The algorithm is described in detail in his his thesis Implementation of a method for hydraulic erosion which can be found here. Below is the before & after of a 512x512 landscape eroded using Erodr.

alt text

Building

To build, simply run make in the root of the repository. I recommend to play around a bit with the optimization flags under CFLAGS in the makefile. On some machines "-O1" produced a faster result than both "-O2" and "-O3". Enabling "-march=native" may improve performance on some machines.

Usage

Usage: erodr -f file [-options]
Simulation options:
    -n ##             Number of particles to simulate (default: 70'000)
    -t ##             Maximum lifetime of a particle (default: 30)
    -g ##             Gravitational constant (default: 4)
    -r ##             Particle erosion radius (default: 2)
    -e ##             Particle enertia coefficient (default: 0.1)
    -c ##             Particle capacity coefficient (default: 10)
    -v ##             Particle evaporation rate (default: 0.1)
    -s ##             Particle erosion coefficient (default: 0.1)
    -d ##             Particle deposition coefficient (default: 1.0)
    -m ##             Minimum slope (default: 0.0001)
Other Options:
    -o <file>         Place the output into <file>
    -a                Output is ASCII encoded

For input and output, Erodr so far only deals with grayscale heightmaps in Netpbm grayscale image format, i.e. *.pgm files. With no other specified options except the input file (with -f), Erodr will run a simulation with the default parameters (listed above) and output the result to output.pgm.

Contribution

This project was written entirely for fun. If anyone wants to contribute feel free to create a pull request.

Keep in mind

The software is provided "as is".

works badge

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.