pure-noise-0.2.1.0: High-performance composable noise generation (Perlin, Simplex, Cellular)
MaintainerJeremy Nuttall <jeremy@jeremy-nuttall.com>
Stabilityexperimental
Safe HaskellNone
LanguageGHC2021

Numeric.Noise.Cellular

Description

 
Synopsis

Configuration

data CellularConfig a Source #

Configuration for cellular (Worley) noise generation.

Cellular noise is based on distances to randomly distributed cell points, creating a distinctive cellular or organic pattern.

Constructors

CellularConfig 

Fields

Instances

Instances details
Generic (CellularConfig a) Source # 
Instance details

Defined in Numeric.Noise.Cellular

Associated Types

type Rep (CellularConfig a) 
Instance details

Defined in Numeric.Noise.Cellular

type Rep (CellularConfig a) = D1 ('MetaData "CellularConfig" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) (C1 ('MetaCons "CellularConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "cellularDistanceFn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CellularDistanceFn) :*: (S1 ('MetaSel ('Just "cellularJitter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "cellularResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CellularResult))))
Show a => Show (CellularConfig a) Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep (CellularConfig a) Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep (CellularConfig a) = D1 ('MetaData "CellularConfig" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) (C1 ('MetaCons "CellularConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "cellularDistanceFn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CellularDistanceFn) :*: (S1 ('MetaSel ('Just "cellularJitter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "cellularResult") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CellularResult))))

defaultCellularConfig :: RealFrac a => CellularConfig a Source #

Default configuration for cellular noise generation.

data CellularDistanceFn Source #

Distance function for cellular noise calculations.

Different distance metrics produce different visual characteristics in the cellular pattern.

Constructors

DistEuclidean

\( \sqrt{dx^2 + dy^2} \) - Creates circular cells with smooth edges.

DistEuclideanSq

\( dx^2 + dy^2 \) - Faster than DistEuclidean with similar appearance.

DistManhattan

\( |dx| + |dy| \) - Creates diamond-shaped cells with sharp edges.

DistHybrid

Hybrid of Euclidean and Manhattan distances.

Instances

Instances details
Bounded CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Enum CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Generic CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Associated Types

type Rep CellularDistanceFn 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularDistanceFn = D1 ('MetaData "CellularDistanceFn" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "DistEuclidean" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistEuclideanSq" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DistManhattan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistHybrid" 'PrefixI 'False) (U1 :: Type -> Type)))
Read CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Show CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Eq CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

Ord CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularDistanceFn Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularDistanceFn = D1 ('MetaData "CellularDistanceFn" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "DistEuclidean" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistEuclideanSq" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DistManhattan" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DistHybrid" 'PrefixI 'False) (U1 :: Type -> Type)))

data CellularResult Source #

What value to return from cellular noise evaluation.

These options allow for different visual effects by returning different properties of the cell structure.

Constructors

CellValue

Return the hash value of the nearest cell point. Creates discrete regions with constant values.

Distance

Return the distance to the nearest cell point. Creates a classic Worley noise pattern with cell boundaries.

Distance2

Return the distance to the second-nearest cell point. Creates larger, more organic-looking cells.

Distance2Add

Return the sum of distances to the two nearest cell points. Creates smooth, rounded cells.

Distance2Sub

Return the difference between distances to the two nearest cell points. Emphasizes cell boundaries and creates sharp edges.

Distance2Mul

Return the product of distances to the two nearest cell points. Creates cells with varying contrast.

Distance2Div

Return the ratio of nearest to second-nearest distance. Creates normalized cell patterns.

Instances

Instances details
Bounded CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Enum CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Generic CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Associated Types

type Rep CellularResult 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularResult = D1 ('MetaData "CellularResult" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "CellValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Distance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Distance2Add" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Sub" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Distance2Mul" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Div" 'PrefixI 'False) (U1 :: Type -> Type))))
Read CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Show CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Eq CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

Ord CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularResult Source # 
Instance details

Defined in Numeric.Noise.Cellular

type Rep CellularResult = D1 ('MetaData "CellularResult" "Numeric.Noise.Cellular" "pure-noise-0.2.1.0-4Gerhi0am1zGiIYaJVZKZH" 'False) ((C1 ('MetaCons "CellValue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Distance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Distance2Add" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Sub" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Distance2Mul" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Distance2Div" 'PrefixI 'False) (U1 :: Type -> Type))))

2D Noise