# GLSL version of Conway's game of life, ported from GLSL sandbox: # http://glsl.heroku.com/e//207.3 # Exemplifies the use of the buffer uniform in the shader, that gives # access to the previous frame. attr_accessor :pg, :conway def setup size(400, 400, P3D) @pg = createGraphics(400, 400, P2D) pg.no_smooth @conway = load_shader("data/conway.glsl") conway.set("resolution", width.to_f, height.to_f) end def draw conway.set("time", millis() / 1000.0) xm = map(mouse_x, 0, width, 0, 1) ym = map(mouse_y, 0, height, 1, 0) conway.set("mouse", xm, ym) pg.begin_draw pg.background(0) pg.shader(conway) pg.rect(0, 0, pg.width, pg.height) pg.end_draw image(pg, 0, 0, width, height) end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Wednesday, 13 February 2013
Conway game of life using shaders in ruby-processing
Hot off the press this example has only just been posted by Andrés Colubri as a vanilla processing example at github (I'm not sure he really meant to create a P3D sketch initially though, P2D seems to work just as well) see java/examples/Topics/Shaders/Conway/data/conway.glsl for shader.
Labels:
conway game of life,
GLSL shader,
ruby-processing
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2013
(94)
-
▼
February
(8)
- My Fork is now at Processing-2.0 and JRuby-1.7.4
- Shader API changed in latest processing version at...
- Hairy Ball (Esfera by David Pena)
- Conway game of life using shaders in ruby-processing
- A graphical example of deep jruby voodoo in ruby-p...
- Deep jruby voodo in ruby-processing
- Sand Traveler Refactored and Updated
- rspec and re-factoring cs_grammar
-
▼
February
(8)
About Me
- monkstone
- I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2
No comments:
Post a Comment