henrikglass / erodr Goto Github PK
View Code? Open in Web Editor NEWAn implementation of Hans Theobald Beyer's algorithm for simulated hydraulic erosion
License: MIT License
An implementation of Hans Theobald Beyer's algorithm for simulated hydraulic erosion
License: MIT License
Hi Henrik,
I got the following error after compiling the exe and trying to run it:
Sorry for the German, it translates to "The procedure entry point GOMP_parallel could not be located in the dll [...]". I suspect I am missing some dll's, as I seemed to be missing "libgomp-1.dll" and "pthreadGC2.dll" when I foolishly executed erodr.exe in hope for a user interface... ^^
I got those DLL's covered, but to no avail. Running the program in powershell, nothing happens:
Do you have any clue what could be wrong? A friend successfully compiled the exe and runs the program just fine (he is a programmer, possibly has the required libraries?), but when transferring the .exe it still won't work for me.
That's funny as hell, but the whole awesomeness of this algorithm relies on a floating point error. Take a look at this part of the code:
p.vel = sqrt(p.vel*p.vel + h_diff*params->p_gravity);
p.water *= (1 - params->p_evaporation);
h_diff is mostly negative and for small enough p.vel this results in NaN value for velocity. And there the magic starts: handling this NaN gracefully will ruin the algorithm since the particle will stop rolling and we need many more iterations or other parameters to have a good-looking erosion.
I found this bug while porting the algorithm to C# and it wasn't working since Math.Min
checks for NaN values and returns NaN resulting in particle stopping, while fmin
returns the number and particles move up for TTL steps or hitting the boundary.
To make the code work the same way I had to add the check if the value under the root is less than zero and if so, set the velocity to FLT_MAX
. It's obviously wrong, although matches the original code.
Ported code:
https://github.com/Nomad1/ErodrSharp
Hi,
the project builds, and it does produce an output picture, but I'm not sure it's actually doing anything.
Can you maybe provide example input / output files to verify against?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.