White Noise

Ported from: https://www.youtube.com/watch?v=l-07BXzNdPw&feature=youtu.be

Demo

▶ Click to play

The noise function is imported, but we then need to set up a proxy function. This is because the macro system relies on inlining, and we want to create a function definition, not just inline the noise code at the point of use.

inline def fragment =
  Shader[FragmentEnv] { env =>
    import ultraviolet.noise.*

    def proxy: vec2 => vec3 =
      p => white(p)

    def fragment(color: vec4): vec4 =
      vec4(proxy(env.UV + fract(env.TIME)), 1.0f)
  }