Cellular Noise
Ported from: https://github.com/ashima/webgl-noise/blob/master/src/cellular2D.glsl
Example Links
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 => vec2 =
pt => cellular(pt)
def fragment(color: vec4): vec4 =
vec4(proxy(env.UV * 8.0f), 0.0f, 1.0f)
}