packages feed

hylogen 0.1.2.2 → 0.1.2.3

raw patch · 7 files changed

+46/−41 lines, 7 files

Files

hylogen.cabal view
@@ -1,8 +1,8 @@ name:                hylogen-version:             0.1.2.2+version:             0.1.2.3 synopsis:            an EDSL for live-coding fragment shaders description:         an EDSL for live-coding fragment shaders-homepage:            https://hylogen.com+homepage:            https://github.com/sleexyz/hylogen author:              Sean Lee license:             MIT maintainer:          freshdried@gmail.com
src/Hylogen/Types/Booly.hs view
@@ -10,6 +10,7 @@   toGLSLType _ = GLSLBool   tag = BoolyType +-- | Hylogen Boolean type type Booly = Expr BoolyType  -- | We use Num operators for Boolean arithmetic:
src/Hylogen/Types/Texture.hs view
@@ -12,4 +12,5 @@   toGLSLType _ = GLSLTexture   tag = TextureType +-- | Hylogen Texture type type Texture = Expr TextureType
src/Hylogen/Types/Vec.hs view
@@ -23,6 +23,7 @@ -- | Floating vector singleton type tag data FloatVec (n :: Nat) = FloatVec +-- | Hylogen floating-point Vector type type Vec n = Expr (FloatVec n) type Vec1 = Vec 1 type Vec2 = Vec 2
src/Hylogen/WithHylide.hs view
@@ -1,3 +1,8 @@+{-|+Exports a standard Hylogen environment with use with Hylide.++-}+ module Hylogen.WithHylide ( module Hylogen.WithHylide.Util                           , module Hylogen.WithHylide.Core                           , module Hylogen
src/Hylogen/WithHylide/Core.hs view
@@ -6,29 +6,17 @@ import           Hylogen.Program  (toProgram)  -osc1 :: Vec1-osc1 = uniform "osc1"+-- | Writes GLSL, without sharing+toGLSL' :: Vec4 -> String+toGLSL' v = unlines [ "void main() {"+                    , "    gl_FragColor = " <> show v <> ";"+                    , "}"+                    ] -osc2 :: Vec1-osc2 = uniform "osc2" -osc3 :: Vec1-osc3 = uniform "osc3"--osc4 :: Vec1-osc4 = uniform "osc4"--osc5 :: Vec1-osc5 = uniform "osc5"--osc6 :: Vec1-osc6 = uniform "osc6"--osc7 :: Vec1-osc7 = uniform "osc7"--osc8 :: Vec1-osc8 = uniform "osc8"+-- | Writes GLSL, with sharing+toGLSL :: Vec4 -> String+toGLSL = show . toProgram . toMono   -- | Pixel coordinates@@ -47,7 +35,7 @@ uvN :: Vec2 uvN = uniform "uvN" --- | Time in milliseconds since start of Hylide+-- | Time in milliseconds since start of Hylide instance time :: Vec1 time = uniform "time" @@ -63,11 +51,11 @@  -- | Intensity of audio input, split into 4 bands ----- low, low-mid, mid, high+-- (low, low-mid, mid, high) audio :: Vec4 audio = uniform "audio" --- | The last rendered frame+-- | The last rendered frame, as a texture backBuffer :: Texture backBuffer = uniform "backBuffer" @@ -75,18 +63,27 @@ channel1 = uniform "channel1"  --- | Writes GLSL------ No sharing-toGLSL' :: Vec4 -> String-toGLSL' v = unlines [ "void main() {"-                    , "    gl_FragColor = " <> show v <> ";"-                    , "}"-                    ] +osc1 :: Vec1+osc1 = uniform "osc1" --- | Writes GLSL------ Sharing via Data.reify-toGLSL :: Vec4 -> String-toGLSL = show . toProgram . toMono+osc2 :: Vec1+osc2 = uniform "osc2"++osc3 :: Vec1+osc3 = uniform "osc3"++osc4 :: Vec1+osc4 = uniform "osc4"++osc5 :: Vec1+osc5 = uniform "osc5"++osc6 :: Vec1+osc6 = uniform "osc6"++osc7 :: Vec1+osc7 = uniform "osc7"++osc8 :: Vec1+osc8 = uniform "osc8"
src/Hylogen/WithHylide/Util.hs view
@@ -19,7 +19,7 @@ -- TODO: hsl  --- | Linear to Exponential Map+-- | Linear to exponential map -- -- @ -- linexp (a, b, c, d) a           -- == c@@ -29,7 +29,7 @@ linexp :: (Floating a) => (a, a, a, a) -> a -> a linexp (a, b, c, d) x = c * ((d / c) ** ((x - a) / (b - a))) --- | Linear to Linear map+-- | Linear to linear map -- -- @ -- linexp (a, b, c, d) a           -- == c