Sha256: d1a65937d3edfbe4b7464ecf33a26617a894abc7fcefe12bd1b31905744e6ef2

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require 'propane'

class Landscape < Propane::App
  #
  # 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  
end

Landscape.new title: 'Landscape'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
propane-0.6.0-java examples/complete/landscape.rb