Read the last section with the header “Rendering Falling Liquids”, it’s purely aesthetic haha

]]>Lost hours just because peoples create fake functions …

Nevermind, thanks for your tutorial ]]>

var c = noise(nx,ny,nz,nw);

var x1 = 0, x2 = 2;

var y1 = 0, y2 = 2;

var dx = x2 – x1;

var dy = y2 – y1;

// Sample noise at smaller intervals

var s = x / width;

var t = y / height;

// Calculate our 4D coordinates

nx = x1 + Math.cos (s*2*Math.PI) * dx/(2*Math.PI);

ny = y1 + Math.cos (t*2*Math.PI) * dy/(2*Math.PI);

nz = x1 + Math.sin (s*2*Math.PI) * dx/(2*Math.PI);

nw = y1 + Math.sin (t*2*Math.PI) * dy/(2*Math.PI);

var c = noise(nx,ny,nz,nw);

The tiletype determines if it is land or water. ]]>