Alternative Noise Implementations

Recently I posted about selectable noise implementation in ruby processing. Since then I’ve done a bit more research and came upon the this post about about OpenSimplex in processing. That got me thinking, why don’t I extend the choice of noise implementations in my ruby-processing projects. So for PiCrate I implemented both OpenSimplex2 versions. Both these noise implementations seem to be superior to both processing ‘Perlin’ and regular ‘Simplex’ noise.

See example PiCrate sketch:-

require 'picrate'
# OpenSimplex has a range -1.0 to 1.0
class NoiseImage < Processing::App
  SCALE = 0.02

  def setup
    sketch_title 'Noise Image'
    background(0)
    stroke(255)
    no_fill
    noise_mode(NoiseMode::OPEN_FAST)
  end

  def draw
    background(0)
    scale = 0.02
    load_pixels
    grid(500, 500) do |x, y|
      col = noise(SCALE * x, SCALE * y) > 0 ? 255 : 0
      pixels[x + width * y] = color(col, 0, 0)
    end
    update_pixels
    save_frame(data_path('OpenFast.png'))
  end

  def settings
    size 500, 500
  end
end

NoiseImage.new

OpenFast
OpenFast
OpenDetail
OpenFast
Simplex
simplex
Perlin (really value noise) adjusted sketch for range 0..1 cf -1.0…1.0`
perlin

It should be noted that within OpenSimplex2, there is a possibility of different options within the noise functions, and I have somewhat arbitrarily chosen one of those options. I might explore making those options selectable, and possibly ditch processing ‘Perlin noise’ which lacks that organic feel…

5 Likes