Exponents in Noise Equations

   3060   1   0
User Avatar
Member
665 posts
Joined: July 2005
Offline
I've tried creating noise expressions using noise(X,Y,Z)^x.

This causes weird flipping of the result. Anyone noise experts out there who have a better method for this?
User Avatar
Member
941 posts
Joined: July 2005
Offline
jacob clark
I've tried creating noise expressions using noise(X,Y,Z)^x.

This causes weird flipping of the result. Anyone noise experts out there who have a better method for this?

The noise functions have an output range of approximately . This means that in your expression noise(x,y,z)^p there's about a 50% chance that you'll be trying to raise a negative number to some exponent. This will work for integer exponents but not necessarily for *all* real-valued exponents – the root of a negative number gives a complex number. Hscript's pow() function returns NaN for these cases:

/ -> echo `pow(-0.5,0.5)`
nan


So maybe try:
pow(abs(noise(x,y,z)),exponent) * sign(noise(x,y,z))

HTH.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
  • Quick Links