Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualEndemoniada

Posted 08 May 2013 - 10:08 AM

Hi guys, I'm trying to make 2D fBM tileable. I can make the underlying Perlin Noise tileable by adding an integer period to the implementation but the fBM built from it does not come out tileable. Any info would be appreciated.


#3Endemoniada

Posted 06 May 2013 - 08:57 PM

Hi guys, I was having problems making tileable fBM but I figured it out so here is a little code tutorial:

 

 

float v=0.0f;
for(i=0;i<octaves;i++){
v+=noise2(x,y,px,py) // px,py is the tileable period
x*=lacunarity;
y*=lacunarity;
px*=lacunarity; // this is what makes it work
py*=lacunarity; // I only tried it with lacunarity fixed at 2
}

 

Let me know if you have any questions.


#2Endemoniada

Posted 06 May 2013 - 08:56 PM

Hi guys, I figured it out so here is a little code tutorial:

 

float v=0.0f;
for(i=0;i<octaves;i++){
v+=noise2(x,y,px,py) // px,py is the tilable period
x*=lacunarity;
y*=lacunarity;
px*=lacunarity; // this is what makes it work
py*=lacunarity; // I only tried it with lacunarity fixed at 2
}

 

Let me know if you have any questions.


#1Endemoniada

Posted 06 May 2013 - 08:40 PM

Hi guys,

 

I'm using a periodic version of Perlin's Improved Noise that tiles very nicely, I thought using that as a building block for fBM would result in tileable fBM but that's not the case. I did some research and couldn't find anything except for this:

 

"The other step, is that when summing the octaves you will want to scale the period with the frequency of the octave. Essentially, you will want each octave to tile the entire just image once, rather than multiple times"...but I don't understand what that means.

 

My fBM looks like this:

 

// speed up table
float freq=1.0f;


for(int i=0;i<octaves;i++){

exp_table[i]=powf(freq,-h);

freq*=lacunarity;

}

 
// generate fbm
float v=0.0f;


for(int i=0;i<octaves;i++){

v+=pnoise2(x,y)*exp_table[i];

x*=lacunarity;

y*=lacunarity;

}

 

For the base I'm using the pnoise2() function from this excellent implementation of Improved Perlin Noise: http://github.com/kev009/craftd/blob/master/plugins/survival/mapgen/noise/noise1234.c

 

Is it really possible to make tileable fBM ? Please help.

 


PARTNERS