Sha256: 4bb10494af923571a4a6c1e0f448e8ca68a8183a78c83830e16e05406f996430

Contents?: true

Size: 460 Bytes

Versions: 4

Compression:

Stored size: 460 Bytes

Contents

attr_reader :nebula

def setup
  size(512, 384, P2D)
  @nebula = load_shader("nebula.glsl")
  nebula.set("resolution", width.to_f, height.to_f) 
end

def draw
  nebula.set("time", millis() / 1000.0)
  shader(nebula)
  # The rect is needed to make the fragment shader go through every pixel of
  # the screen, but is not used for anything else since the rendering is entirely
  # generated by the shader.
  no_stroke
  fill(0)
  rect(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/nebula.rb
ruby-processing-2.4.3 samples/processing_app/topics/shaders/nebula.rb
ruby-processing-2.4.2 samples/processing_app/topics/shaders/nebula.rb
ruby-processing-2.4.1 samples/processing_app/topics/shaders/nebula.rb