Sha256: 67d3fb7057d18227afb64e94c4bdec87cfa5b5a45f8cfe399fcd8c278011434f

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require 'propane'

class Monjori < Propane::App
  ##
  # Monjori.
  #
  # GLSL version of the 1k intro Monjori from the demoscene
  # (http://www.pouet.net/prod.php?which=52761)
  # Ported from the webGL version available in ShaderToy:
  # http://www.iquilezles.org/apps/shadertoy/
  # (Look for Monjori under the Plane Deformations Presets)
   
  attr_reader :monjori
  
  def setup
    size(640, 360, P2D)
    no_stroke
    @monjori = load_shader('monjori.glsl')
    monjori.set('resolution', width.to_f, height.to_f)
  end
  
  def draw
    monjori.set('time', millis / 1000.0)
    shader(monjori)
    # This kind of effects are entirely implemented in the
    # fragment shader, they only need a quad covering the
    # entire view area so every pixel is pushed through the
    # shader.
    rect(0, 0, width, height)
  end  
end

Monjori.new title: 'Monjori'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
propane-0.7.0-java examples/complete/monjori.rb
propane-0.6.0-java examples/complete/monjori.rb