pouët.net

Tags: sphere noise polar etc

category: general [glöplog]
 
How would you generate some sort of perlin noise equality distributed over a sphere, to make some planetioid of sorts?
added on the 2010-04-09 02:11:24 by xernobyl xernobyl
I have found something that had to do with slicing a sphere in random planes and raise a side and lower the other a few times...
added on the 2010-04-09 02:29:10 by xernobyl xernobyl
http://local.wasp.uwa.edu.au/~pbourke/fractals/noise/ that thing over there. it should be easy to render it to a cubemap. any other idea?
added on the 2010-04-09 02:32:59 by xernobyl xernobyl
I know it would not be equaly distributed, but what about 3d perlin noise and sampling in the sphere surface? Maybe it doesn't look bad...
added on the 2010-04-09 02:49:54 by texel texel
for that I could just generate perlin noise over the cubemap faces. and the difference won't be noticeable... but I may learn something this way ;)
added on the 2010-04-09 02:55:50 by xernobyl xernobyl
perlin in the vertex shader? I've seen a lot of perlin displaced spheres...
added on the 2010-04-09 03:02:20 by psonice psonice
If your texture would be 1024*1024...

for (y=0; y<1024; y++) for (x=0; <1024; x++) {
float a = x/1024.0*pi*2.0;
float b = y/1024.0*pi;
br = noise3d(sin(a)*sin(b), cos(b), cos(a)*sin(b));
...
}

... and then you need just a proper noise3d function.

Also, GIMP has a plugin called Felimage Noise or something, which has spherical mapping, unless you're doing an intro.

added on the 2010-04-09 08:59:08 by kurli kurli
Here's a version of the 3D Perlin we used in Muon Baryon and Magnus:
Code: /* Given a position, this function generates a 3D co-ordinates based, * reconstructible static noise. */ float noise(vec3 position) { position.x += position.y * 57. + position.z * 21.; return sin(cos(position.x) * position.x); /* The following is an alternative for the previous line: * return fract(position.x * position.x * .0013) * 2. - 1.; */ } /* Given a position, this function generates a 3D co-ordinates based, * reconstructible linearly interpolated smooth noise. * * This function uses the noise() function above for its underlying * noise texture. */ float smooth_noise(vec3 position) { vec3 integer = floor(position); vec3 fractional = position - integer; return mix(mix(mix(noise(integer), noise(integer + vec3(1, 0, 0)), fractional.x), mix(noise(integer + vec3(0, 1, 0)), noise(integer + vec3(1, 1, 0)), fractional.x), fractional.y), mix(mix(noise(integer + vec3(0, 0, 1)), noise(integer + vec3(1, 0, 1)), fractional.x), mix(noise(integer + vec3(0, 1, 1)), noise(integer + 1.), fractional.x), fractional.y), fractional.z) * .5 + .5; } /* Given a position, this function constructs the oh-so-famous Perlin * noise. */ float perlin(vec3 position) { return smooth_noise(position * .06125) * .5 + smooth_noise(position * .125) * .25 + smooth_noise(position * .25) * .125; }


It's pretty hard-coded as it was meant for size-coding, but of course you can parameterize easily. Also this is the human-readable version of the obfuscated code.
added on the 2010-04-09 10:57:16 by decipher decipher
Note: The alternative line was invented by Mentor and me at the Assembly party place 3 hours before the deadline. It doesn't look when used individually but it is pretty fast and has a relatively smaller footprint in the shader sources. So, kudos to Mentor for trial and error :).
added on the 2010-04-09 10:58:48 by decipher decipher

login