perlin-noise ( table: byte-array point: float-4 -- value: float )


Vocabulary
noise

Inputs
tablea byte-array
pointa float-4


Outputs
valuea float


Definition


TYPED:: perlin-noise
( table: byte-array point: float-4 -- value: float )
point floor-vector :> _point_ _point_ unit-cubed :> cube
point _point_ v-
:> gradients gradients fade :> faded table cube first3
hashes {
[ gradients grad ]
[ gradients float-4{ 1.0 0.0 0.0 0.0 } v- grad ]
[ gradients float-4{ 0.0 1.0 0.0 0.0 } v- grad ]
[ gradients float-4{ 1.0 1.0 0.0 0.0 } v- grad ]
[ gradients float-4{ 0.0 0.0 1.0 0.0 } v- grad ]
[ gradients float-4{ 1.0 0.0 1.0 0.0 } v- grad ]
[ gradients float-4{ 0.0 1.0 1.0 0.0 } v- grad ]
[ gradients float-4{ 1.0 1.0 1.0 0.0 } v- grad ]
} spread faded trilerp ;