aboutsummaryrefslogtreecommitdiffstats
path: root/src/Vivant/Noise.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Vivant/Noise.hs')
-rw-r--r--src/Vivant/Noise.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Vivant/Noise.hs b/src/Vivant/Noise.hs
index bf2b197..a9a3b47 100644
--- a/src/Vivant/Noise.hs
+++ b/src/Vivant/Noise.hs
@@ -390,20 +390,19 @@ main = do
pixelRenderer, pixelRenderer' :: String -> Int -> Int -> Word8
pixelRenderer !n !x !y =
doubleToByte $
- ( ( perlin3
- permutation
- ( (fromIntegral x - 32) / 4,
- (fromIntegral y - 32) / 4,
- read n :: Double
- )
- )
+ ( perlin3
+ permutation
+ ( (fromIntegral x - 32) / 4,
+ (fromIntegral y - 32) / 4,
+ read n :: Double
+ )
+ 1
)
/ 2
* 128
pixelRenderer' !n x y =
- (\w -> doubleToByte $ ((w + 1) / 2 * 128)) -- w should be in [-1,+1]
+ (\w -> doubleToByte ((w + 1) / 2 * 128)) -- w should be in [-1,+1]
. perlin3 permutation
. (\(x, y, z) -> ((x -256) / 32, (y -256) / 32, (z -256) / 32))
$ (fromIntegral x, fromIntegral y, 0 :: Double)