Sha256: d7bf64b0aab0d48185c8f30e6dd2a77fe8c8b02e4c08517294ab48e476077b7a

Contents?: true

Size: 618 Bytes

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.6.2 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.6.1 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.6.0 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.5.1 samples/processing_app/topics/shaders/deform.rb
ruby-processing-2.5.0 samples/processing_app/topics/shaders/deform.rb