Giter Site home page Giter Site logo

weigert / soilmachine Goto Github PK

View Code? Open in Web Editor NEW
255.0 9.0 13.0 61.22 MB

Advanced, modular, coupled geomorpohology simulator for real-time procedural terrain generation.

C++ 89.87% Makefile 0.43% GLSL 2.17% C 3.67% C# 3.86%
terrain-generator erosion simulation hydrology

soilmachine's Introduction

SoilMachine

Advanced, modular, coupled geomorpohology simulator for real-time procedural terrain generation in C++.

Visualization with TinyEngine.

Article: An Efficient Data Structure for 3D Multi-Layer Terrain and Erosion Simulation

Description

SoilMachine is a unified geomorphology simulator for procedural terrain. It represents the culmination of a lot of work on particle-based transport and erosion systems (hydraulic and wind). Most importantly, a new layered terrain data structure allows for modeling surface and sub-surface phenomena based on particle transport with multiple soil types, which exceeds the functionality of voxels.

Banner

SoilMachine is written from scratch in very little code and visualized with TinyEngine using a technique called vertex pooling, which obviates the need to remesh the heightmap (ever). It is designed to be modular and expandable.

This repo is currently in development and will probably not be done soon but I am publishing it so updates can be followed live for anybody who is interested.

Utilization

Tested on Ubuntu20 LTS. See below for how to build.

Reading:

  <> optional
  [] required

Run:

  ./soilmachine <options/flags>

Options:

  -SEED [#]     Run using sed. No seed = random
  -soil [file]  Specify relative path to .soil file

  -oc [file]    Export color map to .png file at relative path (on program exit)
  -oh [file]    Export height map to .png file at relative path (on program exit)

Note: More options and flags are planned in the future. See the todo.md file for more information.

Controls

ESC: Toggle GUI
P: Toggle Pause (Paused by default!!!)

Scroll-Y: Zoom
Scroll-X: Camera Angle
Arrow Keys: Camera Orientation
C / V: Move Camera Up / Down
WASD: Move Camera in Plane

In the GUI, a number of things can be done, including Re-Seeding the map, setting erosion parameters, tuning the soil properties without re-launching the program and tuning the visualization. More features are planned in the future (see todo.md for more information).

Building & Running

SoilMachine is visualized using TinyEngine. Install TinyEngine using the instructions at the repo:

https://github.com/weigert/TinyEngine

TinyEngine is the only dependency (besides sub-dependencies).

Once that works, build SoilMachine using the makefile and run in place (no install):

cd ~
git clone https://github.com/weigert/SoilMachine
cd SoilMachine
make all
./soilmachine

Features

Implemented

  • Vertexpool based heightmap visualization (OpenGL AZDO) to eliminate remesh cost
  • Layered terrain data structure using memory pooled, run-length encoded sediment sections as a linked list on a grid
  • Modular soil type description and "erosion chains"
  • Modular description of transport types using a particle base class
  • GUI Interface for Initial Terrain
  • GUI Interface for Defining Sediment Properties
  • Data Export (Using Commandline Flags)

Planned

  • Parallelization of the particle base class terrain interaction
  • Sediment compaction / conversion
  • Water-logging using sediment porosity
  • Implementation of multiple water tables based on Particle-Based Hydrology

Screenshots

Some example outputs:

Output 1

Output 2

Output 3

License

MIT License

soilmachine's People

Contributors

giucam avatar weigert 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

soilmachine's Issues

g++ version, make warnings, and shader compatibility issues

I am attempting to use this on Arch and have run into a few issues.

The makefile specifies a particular g++ version, causing it to fail, which I fixed by changing "g++-10" to just "g++".

Once I got it to build, it printed several warnings about invoking undefined behavior, which may or may not be relevant, but i'll include them just in case:

makewarnings.txt

On execution, I was getting a window but nothing was displaying, so I tried using tiny engine's compatibility macro. I changed the last line of the makefile to the following (I'm not sure exactly where to put the macro, but it gave the same results putting it in other parts of the line):

$(CC) SoilMachine.cpp $(CF) $(LF) -lTinyEngine $(TINYLINK) -D TINYENGINE_COMPATIBILITY -o soilmachine

After this, it displays a glitchy window then crashes. Running from terminal gives the following output:

compatibilityerror.txt

It seems to be running into issues with GLSL 4.30 and 4.60 shaders.

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.