Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Created June 19, 2018 23:00
Show Gist options
  • Save mimetaur/2fd965d6c89031a87065df1770b32b88 to your computer and use it in GitHub Desktop.
Save mimetaur/2fd965d6c89031a87065df1770b32b88 to your computer and use it in GitHub Desktop.
Sketch 6 / Noise displacement wrangle
float noise_freq = ch("noise_freq");
float strength = ch("strength");
vector2 noise_offset = chu("noise_offset");
float time_speed = ch("time_speed");
float x_noise = (@P.x * noise_freq) + (@Time * time_speed) + noise_offset.x;
float z_noise = (@P.z * noise_freq) + (@Time * time_speed) + noise_offset.y;
vector noise_seed = set(x_noise, 0, z_noise);
// let downstream nodes access this value
vector bal_noise = fit(noise(noise_seed), {0, 0, 0}, {1, 1, 1}, {-1, -1, -1}, {1, 1, 1});
v@noiseval = bal_noise * strength;
@P.x += @noiseval.x;
@P.z += @noiseval.y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment