Jump to content
  • Advertisement
Sign in to follow this  
laeuchli

Tiling Simplex Noise

This topic is 3836 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

Dear All, I'm trying to create some tilable Simplex noise. Using the tiling method I used to use for regular perlin noise(http://www.cs.cmu.edu/~mzucker/code/perlin-noise-math-faq.html), I've created the function below: double TiledNoise(double x, double y, double z, double ti, double tj, double tk) { double tiled = SimplexNoise(x, y, z) * ( x - ti ) * ( y - tj ) * ( z - tk ) + SimplexNoise(x - ti, y, z) * ( x ) * ( y - tj ) * ( z - tk ) + SimplexNoise(x, y - tj, z) * ( x - ti ) * ( y ) * ( z - tk ) + SimplexNoise(x - ti, y - tj, z) * ( x ) * ( y ) * ( z - tk ) + SimplexNoise(x, y, z - tk) * ( x - ti ) * ( y - tj ) * ( z ) + SimplexNoise(x - ti, y, z - tk) * ( x ) * ( y - tj ) * ( z ) + SimplexNoise(x, y - ti, z - tk) * ( x - ti ) * ( y ) * ( z ) + SimplexNoise(x - ti, y - tj, z - tk) * ( x ) * ( y ) * ( z ); return tiled / (ti * tj * tk); } and calling it as follows: for(float z = 0; z < 128; z++) for(float y = 0; y < 128; y ++) for(float x = 0; x < 128; x++) file<<TiledNoise(x/10,y/10,z/10, 12.8, 12.8, 12.8)<<" "; So as far as I can see this looks correct, but when I look at the generated noise, it not acctually tileable, its off by a small margin. Can anyone see mistake I'm making? Regards, Jesse

Share this post


Link to post
Share on other sites
Advertisement
x, y and z must be in the 0-ti, 0-tj, 0-tk range if I remember well. So you could try to add a:

x = fmod(x, ti)
y = fmod(y, tj)
z = fmod(z, tk)

at the beginning of your "TiledNoise" function.

Y.

Share this post


Link to post
Share on other sites
Doesnt seem to effect anything. I'm getting the same problem when I substitute perlin for simplex noise as well :/.

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!