Jump to content
  • Advertisement
Sign in to follow this  
Calneon

3D Ridged Multifractal

This topic is 2603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to convert this code into 3D, but I'm struggling because I don't really understand what it's doing. I've tried searching for an explanation of ridged multifractals but couldn't find anything. Could somebody give me some pointers?

Share this post


Link to post
Share on other sites
Advertisement
It looks like it's using 2D Perlin Noise to generate a height map. A ridged multifractal, according to this source, says that it is almost the same as regular Perlin Noise but "it's made by taking the absolute value of the Perlin basis—that is, by changing the sign of all negative values to positive—and turning that upside down."

Share this post


Link to post
Share on other sites
Thanks for the link, I'll have a read through of that. I'm trying to get the same outcome as shown on this page. I edited the 2D code and I get something similar, but I can't help but feel there is a faster way of doing it, currently for each cell and each octave is uses the noise function 8 times...

float interpolatedNoise(float x, float y, float z)
{
int integer_X=(int)x;
float fractional_X = x-integer_X;

int integer_Y=(int)y;
float fractional_Y=y-integer_Y;

int integer_Z=(int)z;
float fractional_Z=z-integer_Z;

float vec[3];

vec[0] = integer_X;
vec[1] = integer_Y;
vec[2] = integer_Z;
float v1 = Noise(vec);

vec[0] = integer_X+1;
vec[1] = integer_Y;
vec[2] = integer_Z;
float v2 = Noise(vec);

vec[0] = integer_X;
vec[1] = integer_Y+1;
vec[2] = integer_Z;
float v3 = Noise(vec);

vec[0] = integer_X+1;
vec[1] = integer_Y+1;
vec[2] = integer_Z;
float v4 = Noise(vec);

vec[0] = integer_X;
vec[1] = integer_Y;
vec[2] = integer_Z+1;
float v5 = Noise(vec);

vec[0] = integer_X+1;
vec[1] = integer_Y;
vec[2] = integer_Z+1;
float v6 = Noise(vec);

vec[0] = integer_X;
vec[1] = integer_Y+1;
vec[2] = integer_Z+1;
float v7 = Noise(vec);

vec[0] = integer_X+1;
vec[1] = integer_Y+1;
vec[2] = integer_Z+1;
float v8 = Noise(vec);

float i1=interpolate(v1,v2,fractional_X);
float i2=interpolate(v3,v4,fractional_X);
float i3=interpolate(v5,v6,fractional_X);
float i4=interpolate(v7,v8,fractional_X);

float j1=interpolate(i1,i2,fractional_Y);
float j2=interpolate(i3,i4,fractional_Y);

return interpolate(j1,j2,fractional_Z);
}

Share this post


Link to post
Share on other sites

Thanks for the link, I'll have a read through of that. I'm trying to get the same outcome as shown on this page. I edited the 2D code and I get something similar, but I can't help but feel there is a faster way of doing it, currently for each cell and each octave is uses the noise function 8 times...



8 times for a 3D noise sample is pretty much par for the course using original Perlin noise. Perlin's simplex noise is more scalable since the number of samples increases linearly as dimension increases, rather than exponentially, but the actual implementation of the simplex wavelet function gets significantly more complicated for higher dimensions. It's still pretty simple for the 3D case, though, and the preceding link provides an implementation of 3 and 4D.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!