Sha256: de471becae4b16f4315d59618965365624fb279230428412264c5ff2a8fec58e

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

#
# Deform. 
# 
# A GLSL version of the oldschool 2D deformation effect, by Inigo Quilez.
# Ported from the webGL version available in ShaderToy:
# http://www.iquilezles.org/apps/shadertoy/
# (Look for Deform under the Plane Deformations Presets)
# 
#
 
attr_reader :tex, :deform

def setup
  size(640, 360, P2D)
  
  textureWrap(REPEAT)
  @tex = loadImage("tex1.jpg")
 
  @deform = loadShader("deform.glsl")
  deform.set("resolution", width.to_f, height.to_f)
end

def draw
  deform.set("time", millis / 1000.0)
  deform.set("mouse", mouse_x.to_f, mouse_y.to_f)
  shader(deform)
  image(tex, 0, 0, width, height)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-processing-2.4.4 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.4.3 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.4.2 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.4.1 samples/processing_app/topics/shaders/deform.rb