/glsl-fbm

Fractional Brownian Motion in glsl

Primary LanguageGLSL

glsl-fbm

Fractional Brownian Motion(fBM) ported to an NPM package for glslify. Also check out GLSL Noise Algorithms

Installation

npm install glsl-fbm

Usage

attribute vec3 position;
attribute vec2 uv;
uniform float time;

#pragma glslify: fbm = require(glsl-fbm)

void main() {
  vec3 pos = position;
  float height = fbm(vec3(uv, time));
  pos.y += height;
  
  gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(pos, 1.0);
}