Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#Actualunbird

Posted 28 April 2013 - 07:18 AM

Now you lost me, I can't quite follow. What array ? You now (should) have a texture which wraps, you won't get an "out of bounds" here. Again: Texture co-ordinates are normalized (0..1). Then again: With a proper perlin noise in place you can feed it any scale (aka frequency) you like. That's the whole beauty of perlin noise.
 
Can you post your (complete) shader code and what you feed it (your terrain mesh) ?
 
PS: Maybe playing with perlin alone, i.e. decoupled from your terrain stuff and generate some textures first (this time in the pixel shader) would be a good idea. It's also easier to check if it actually produces correct results.

Edit: Sorry, now I get it (was too late yesterday and reading more carefully helps tongue.png). So you still have an array for the gradients. Not sure what the shader produces with out of bounds, but it probably won't wrap automatically. Static arrays may get translated to a sequence of "ifs" (in assembly movc IIRC). So wrap manually or use a texture for the gradient too.

By the way: It "breaks" with a constant value of 100, since then the compiler can check that at compile time. Well, that's just my guess without seeing code.

#1unbird

Posted 27 April 2013 - 04:04 PM

Now you lost me, I can't quite follow. What array ? You now (should) have a texture which wraps, you won't get an "out of bounds" here. Again: Texture co-ordinates are normalized (0..1). Then again: With a proper perlin noise in place you can feed it any scale (aka frequency) you like. That's the whole beauty of perlin noise.

 

Can you post your (complete) shader code and what you feed it (your terrain mesh) ?

 

PS: Maybe playing with perlin alone, i.e. decoupled from your terrain stuff and generate some textures first (this time in the pixel shader) would be a good idea. It's also easier to check if it actually produces correct results.


PARTNERS