Giter Club home page Giter Club logo

simplehydrology's Introduction

SimpleHydrology

C++ implementation of a particle based procedural hydrology system for terrain generation. This extends simple particle based hydraulic erosion to capture streams and pools.

Rendered using my homebrew TinyEngine.

Link to a blog post about this

Banner Image

Compiling

Use the makefile to compile the program.

make all

Dependencies

Erosion System:
- gcc
- glm
- libnoise

Renderer (TinyEngine):
- SDL2 (Core, Image, TTF, Mixer)
- OpenGL3
- GLEW
- Boost
- ImGUI (included already as header files)

Usage

./hydrology [SEED]

If no seed is specified, it will take a random one.

Controls

- Zoom and Rotate Camera: Scroll
- Toggle Pause: P (WARNING: PAUSED BY DEFAULT!!)
- Change Camera Vertical Angle: UP / DOWN
- Toggle Hydrology Map View: ESC
- Move the Camera Anchor: WASD / SPACE / C

Screenshots

Example Output Example output when simulating on semi-rugged terrain.

Hydrology Map Example of a generated hydrology map.

Terrain Render Corresponding rendering of the terrain.

Reading

The main file is just to wrap the OpenGL code for drawing. At the very bottom, you can see the main game loop that calls the erosion and vegetation growth functions.

The part of the code described in the blog article is contained in the file water.h. Read this to find the implementation of the procedural hydrology.

The trees are implemented in vegetation.h.

All of the code is wrapped with the world class in world.h. The bottom of this file contains a bunch of stuff relevant for rendering, but not the erosion system.

The rest is shaders and rendering stuff.

License

MIT License.

See my website for a more detailed copyright notice.

simplehydrology's People

Contributors

weigert avatar

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.