@hackage hylogen0.1.1.2

an EDSL for live-coding fragment shaders

H Y L O G E N

Hackage Status

Hylogen is a purely functional language embedded in Haskell for live-coding fragment shaders, featuring:

  • a simple and pure syntax
  • standard operators (+, *, *^, <.>)
  • compat. w/ your fav haskell goodies (higher-order functions, ADTS, swanky polymorphism).

It comes with hylide, an accompanying rendering environment featuring:

  • hot-reloading
  • audio-reactive primitives
  • texture backbuffering

Install

cabal update
cabal install hylogen

This will install the hylogen package and hylide, the rendering environment.

Usage

-- ./Main.hs
module Main where
import Hylogen.WithHylide

color = vec4 (a, a, a, 1)
  where
    a = cos(uvN !X * sin(time / 10) * 10 + mouse !X)
      + sin(uvN !Y * sin(time / 10) * 10 + mouse !Y)

main = putStrLn . toGLSL $ color

1. run hylo...

hylo Main.hs

2. ... live-code!

Go to localhost:5678 in your browser.

You will now see your changes to Main.hs propagate to your WebGL rendering environment!

References

Resources