I'm trying to achieve the effect from https://www.iquilezles.org/www/articles/warp/warp.htm
with no success. Here is the experiment http://jsfiddle.net/fro5y0jm/15/ with canvas. Any ideas?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI'm trying to achieve the effect from https://www.iquilezles.org/www/articles/warp/warp.htm
with no success. Here is the experiment http://jsfiddle.net/fro5y0jm/15/ with canvas. Any ideas?
Looks like your domain warping amplitude is just too small.
Crank up your q
to about 20x its current value and you'll get very pronounced domain warping:
I made this image by modifying your code to replact the 4.0*
with 80.0*
:
function pattern(x, y, scale, octaves, lacunarity, gain){
var q = [
fbm(x, y, scale, octaves, lacunarity, gain),
fbm(x+5.2, y+1.3, scale, octaves, lacunarity, gain),
];
return fbm(x+80.0*q[0], y+80.0*q[1], scale, octaves, lacunarity, gain);
}