Title: simple non-standard approaches Post by: eiffie on February 14, 2012, 11:59:53 PM I'm always looking for shortcuts so when I wanted some terrain with waves in it rather than adding waves to the standard diamond square method I built one out of sine waves.
http://www.youtube.com/watch?v=GTp71zHLfvM Code: uniform vec3 eye; //the camera position Does anyone have any similar terrain tricks? Title: Re: simple non-standard approaches Post by: AndyAlias on December 17, 2012, 10:48:24 PM This is really nice. Better than Elevated, even :) (if not as fast)
Interesting that it doesn't seem to suffer from over stepping. It's quite a bit faster if you get rid of the length() in the inner loop. I got some interesting terrain results by mixing (ie mix(d1,d2,0.5)) KIFS fractals with spheres: http://www.thealphablenders.com/2012/11/more-alien-vistas/ Title: Re: simple non-standard approaches Post by: eiffie on December 18, 2012, 06:16:42 PM Nice blog - glad to see more people writing about DE!
Title: Re: simple non-standard approaches Post by: eiffie on January 11, 2013, 06:43:51 PM Here are some simple GLSL terrain generators. I love it when you can build a world from a few lines of code.
The first was a naive attempt by me simply using smoothstep. It has smooth square patterns in the first few iterations then looks OK. Code: float rand( vec3 co ){//2d version from lumina extendedThe second is a vectorized version of Inigo Quilezles' FBM which you can read about here: http://iquilezles.org/www/articles/morenoise/morenoise.htm (http://iquilezles.org/www/articles/morenoise/morenoise.htm) Code: vec4 dnoise3d(vec3 z){I think a combination of the wave generator for a few iterations then an FBM looks nice since at large scales the earth's crust acts like a fluid compressing and relaxing creating waves (mountain ranges and valleys). Title: Re: simple non-standard approaches Post by: DarkBeam on January 12, 2013, 11:29:34 AM Tip; have you tried to replace
Code: amp=pow(amp,1.25); with Code: amp=amp*sqrt(sqrt(amp)); Should be faster, I'm not sure :beer: Title: Re: simple non-standard approaches Post by: DarkBeam on January 12, 2013, 06:35:44 PM I have implemented it in Mandelbulb, it's very hard to get a realistic terrain "with mountains" with a good detail level. :'( I tried hard, but the most decent result was this.
It looks somewhat like a "rose" - i think because you strongly rely on radius for the noise (length(z)*2.33 ... 2.33 is a lot). The worst defect is that amplitude varies without a lower limit so if it's like 0.1 after some its it goes to 0. :sad1: this means, too low amplitude for higher its... So after 5-6 iters you don't get more details even if you use more iters Title: Re: simple non-standard approaches Post by: DarkBeam on January 12, 2013, 06:56:48 PM So ok, I made those modifications;
int mit=9; // more for more detail float h=0.0; //float sh=2.5; float sh=1.2; // looks better than yours imho vec2 offset=vec2(sh+phase*0.1,1.0+phase*0.07); //phase animates the waves for(int i=0;i<mit;i++){ z=z*rmx*freq+offset; //rotate, scale and translate h+=sin(z.x+phase)*sin(z.y+phase)*sin(length(z)*sh+phase)*amp; //I recycled 2.5 to save constants but other vals may be better - and I dunno why you putted phase x 1.33 :) if amp > 0.001 { amp=pow(amp,1.25); } } return 0.125 * pow2(h,0.5); // while pow2(a,b) = sgn(a)*pow(abs(a),abs(b)) but try other stuff for those floats :D Title: Re: simple non-standard approaches Post by: eiffie on January 15, 2013, 04:56:21 PM Much better terrain DarkBeam but now it no longer looks like waves :) I guess you can't have both. Will you be able to mix this with other formulas?? That would be interesting.
Title: Re: simple non-standard approaches Post by: Woz on January 24, 2013, 01:21:40 AM I have implemented it in Mandelbulb, it's very hard to get a realistic terrain "with mountains" with a good detail level. :'( I tried hard, but the most decent result was this. I use Mojoworld Pro its a terrain generator using fractal design elements. Your result looks similar to my Voronoi Volumetrics landscape.It looks somewhat like a "rose" - i think because you strongly rely on radius for the noise (length(z)*2.33 ... 2.33 is a lot). The worst defect is that amplitude varies without a lower limit so if it's like 0.1 after some its it goes to 0. :sad1: this means, too low amplitude for higher its... So after 5-6 iters you don't get more details even if you use more iters (http://www.renderosity.com/mod/gallery/media/folder_239/display_2386903.jpg) The nearest to any reasonable looking terrain Ive managed with MB3D is this.... (http://s2.postimage.org/8s0qvhq4p/image.jpg) Mandelbulb3Dv18{ b.....k1...Q6...D....2A....g95c9PceozGJwAvqK4.2EKg7d3UGUc.QTNtD22oJ6.jX/hGQYF0uD ................................CQTdB/C4a.2.......U9.p6........E.......EE/2...wD ...Uz.....U52.../w.1/......8....J0...2k4.....2l9/hTXUdkD/w.uYOAEDeee2xckpn1.OaNa z.....cD16../2.iSIsuFVfXz.........yjnAnAnAnA1z9..........c.u1....y1...sD...../.. .wXaNadDCWGuioIuXvvvSw1ozY88z03So3sqRJijNGb0.a88Iwf/q/UxjIuuyYDNwD1p1Omj1IW0oqzW awHe6wZQqPhoy0QpWMY45Flj.....72j4...v5........sD.2....sD1.E..................... .............oAnAt1...sD....z.rbE7.2U0Z.k08I0.JcE7.wV0Z.E88I0.ncE7.8yV8EE....2.. .....AQxcz1.....9.kz/wzzznlj.Y8.R....61...EH....h/.06M8..UUszzzzH....MJ7..kii.5g ..UU0yzzC16E...U.1Ak.0.U.9M61k/..0sz..EbG7eFT5wj4Ak5eP./czH..........20/8.kU/t0. .....................6..........X6V0.wzzza...0.......g0U......../.M3ZaYq1zP05c.. YZaO............S/..........2aUODFhwzIk7tozf5q1..grio9XW8.I091WZUJsxz.UIhlTrxLyj ZQG1zvOPy...KZajjzXyz0kYEkti4xwD.EO89.34Lz9..wPXG/EiahX7zzlNVs1.APtGoszDzhLB.QSe dZHzTZtW1/Ugyho6QsLYJO0.T...a.bT4K16.sxaTN0lyp2IZ..dUJW7Mw5cbU3.1i1/akqTm/bJ.o/. .M0kzxsL./k3..U7...crIGJzzFoTuIdyzngi8qdxzZX.4rU.wKRiFLMdt46KZKNrtWOkR4.5tWOkR4. E....A....E.....I....U....EEh3aSdtqNUAJRmN4...........................k/.MU/4.U. ..........ED8QxckpXzz.........yD........E.2........7./..................2.2..... ..............zD................................................................ .....................2.....3....1....wZIjFLMoJ4................................. 4MU/.........................EyD..........2..................................... ................................................................................ ................................/....E/..../....T7pPo34RZFaFjl4NdtqN............ ..........U/4M..........................E.2........../.......U/Eg53iSIsu/z1..... ................................................................................ ............................................} Title: Re: simple non-standard approaches Post by: alexl on March 25, 2013, 09:26:24 PM OK, I it's my 5 cents:
Screenshot: (http://sanbase.org/jpg/000250.2.jpg) one more: (http://sanbase.org/jpg/x1607.jpg) Video: http://www.youtube.com/watch?v=ChzIJ1RfvmQ Title: Re: simple non-standard approaches Post by: weavers on March 26, 2013, 01:23:23 AM Thank you Master the Fractal Forums the possibilities are infinite . |