Skip to content

Instantly share code, notes, and snippets.

// See the paper "Implementation of a method for hydraulic erosion" by Hans Theobald Beyer (http://www.firespark.de/resources/downloads/implementation%20of%20a%20methode%20for%20hydraulic%20erosion.pdf) which has examples for all the parameter values
// particleCount number of particles to drop on the terrain
// particleInertia 0 to 1 defines how much changes in the gradient change the direction of the particle. Values near 0.1 work best
// particleCapacity 0 to 100 ish, defines how much sediment each particle can hold onto. Larger values erodes mountains more
// particleDeposition 0 to 1 limits the sediment that is dropped if the sediment carried by the drop exceeds the drops carry capacity
// particleErosion 0 to 1 determines how much of the free capacity of a drop is filled with sediment in case of erosion
// particleEvaporation 0 to 1 defines how fast the particle's waterAmount decreases. Values less than 0.1 work best
// particleRadius, 1 to 10 ish Used during erosion to decide how far away from the part
@sirisian
sirisian / Log.cpp
Created January 17, 2016 08:25
C++ Logger
#include "Log.hpp"
Section::Section(const char* name) : Name(name)
{
}
LogProxy::LogProxy(const char* level) : message(new std::stringstream)
{
*message << level;
}
@sirisian
sirisian / Packet.js
Last active December 2, 2022 05:20
Type Proposal Example
/**
* A binary bit-based writer and reader designed for packets.
* @class
*/
export class Packet {
/**
* The byte buffer for the packet.
*/
#buffer:[]<uint32>
/**
#include "Log.hpp"
#include <windows.h>
Section::Section(const char* name) : Name(name)
{
}
LogProxy::LogProxy(const char* level) : message(new std::stringstream)
{
/// <var>A binary bit-based writer and reader used for packets.</var>
var Packet =
{
Create: function()
{
/// <signature>
/// <summary>Constructor.</summary>
/// <returns type="Packet" />
/// </signature>
/// <signature>