shady-graphics-0.5.0: Functional GPU programming - DSEL & compiler

Stabilityexperimental
Maintainerconal@conal.net

Shady.ParamSurf

Description

Parametric surfaces with automatic normals

Synopsis

Documentation

type HeightField s = Complex s -> sSource

type Surf s = Complex s -> (s, s, s)Source

type USurf = forall s. Floating s => Surf sSource

type Curve2 s = s -> Complex sSource

type Curve3 s = s -> (s, s, s)Source

type Warp1 s = s -> sSource

type Warp2 s = Complex s -> Complex sSource

type Warp3 s = (s, s, s) -> (s, s, s)Source

sinU :: Floating s => s -> sSource

Trig functions with unit period ([-1,1])

cosU :: Floating s => s -> sSource

hfSurf :: HeightField s -> Surf sSource

Turn a height field into a surface

fcurve :: Warp1 s -> Curve2 sSource

Like hfSurf but for curve construction

circle :: Floating s => Curve2 sSource

Unit circle.

semiCircle :: Floating s => Curve2 sSource

Half semi circle, with theta in [-pi2,pi2]

torus :: (Floating s, VectorSpace s, Scalar s ~ s) => s -> s -> Surf sSource

Torus, given radius of sweep circle and cross section

revolveG :: Floating s => (s -> Curve2 s) -> Surf sSource

profile :: Num s => Curve2 s -> Curve2 s -> Surf sSource

Profile product.

frustum :: (Floating s, VectorSpace s, Scalar s ~ s) => s -> s -> s -> Surf sSource

Frustum, given base & cap radii and height.

ucylinder :: (Floating s, VectorSpace s) => Surf sSource

Unit cylinder. Unit height and radii

xyPlane :: Num s => Surf sSource

XY plane as a surface

cartF :: (a -> b -> c) -> (s -> a) -> (s -> b) -> Complex s -> cSource

Given a combining op and two curves, make a surface. A sort of Cartesian product with combination.

eggcrateH :: Floating s => HeightField sSource

One period, unit height eggcrate

ripple :: Floating s => Surf sSource

Simple ripply pond shape

displaceV :: (InnerSpace v, s ~ Scalar v, Floating s, HasNormal v) => v -> Scalar v -> vSource

Apply a displacement map at a value

displace :: (InnerSpace v, Scalar v ~ s, Floating s, HasNormal v, Applicative f) => f v -> f (Scalar v) -> f vSource

Apply a displacement map to a function (e.g., Curve2 or Surf) or other container.

rotate :: Floating s => s -> Warp2 sSource

addY :: Num s => (a -> Complex s) -> a -> (s, s, s)Source

addZ :: Num s => (a -> Complex s) -> a -> (s, s, s)Source

addX :: Num s => (a -> Complex s) -> a -> (s, s, s)Source

addXZ :: Num s => (a -> s) -> a -> (s, s, s)Source

addXY :: Num s => (a -> s) -> a -> (s, s, s)Source

addYZ :: Num s => (a -> s) -> a -> (s, s, s)Source

onY' :: Warp1 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

onZ' :: Warp1 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

onX' :: Warp1 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

onXZ' :: Warp2 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

onYZ' :: Warp2 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

onXY' :: Warp2 s -> (a -> (s, s, s)) -> a -> (s, s, s)Source

type V2 a = (a, a)Source

type V3 a = (a, a, a)Source

type ER2 = V2 ERSource

type ER3 = V3 ERSource

type TR = ER :> ERSource

type T = ER2 :> ERSource

type SurfPt = V3 TSource

Derivative towers of point on a surface

type SurfD = Surf TSource

Differentiable surface

type VN = (R3E, R3E)Source

Vertex and normal

type SurfVN = R2E -> VNSource