Sha256: a84fdbebb4dd292a8004058d7814164c2ecd5cbb88d5afbd9c023cffa95e17e0

Contents?: true

Size: 807 Bytes

Versions: 5

Compression:

Stored size: 807 Bytes

Contents

#
# Elevated
# https://www.shadertoy.com/view/MdX3Rr by inigo quilez
# Created by inigo quilez - iq/2013
# License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
# Processing port by Raphaƫl de Courville.
#
 
attr_reader :landscape

java_alias :background_int, :background, [Java::int]

def setup
  size(640, 360, P2D)
  no_stroke
   
  # The code of this shader shows how to integrate shaders from shadertoy
  # into Processing with minimal changes.
  @landscape = load_shader('landscape.glsl')
  landscape.set('resolution', width.to_f, height.to_f)  
end

def draw
  background_int 0
    
  landscape.set('time', (millis/1000.0).to_f)
  shader(landscape) 
  rect(0, 0, width, height)

  frame.set_title "frame: #{frame_count} - fps: #{format('%0.2f', frame_rate)}"     
end

Version data entries

5 entries across 5 versions & 1 rubygems

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