ruby-processing 1.0.11 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +6 -0
- data/.yardopts +5 -0
- data/CHANGELOG +81 -0
- data/CONTRIBUTING.md +33 -0
- data/Gemfile +6 -0
- data/{LICENSE → LICENSE.md} +6 -4
- data/README.md +114 -0
- data/Rakefile +37 -0
- data/bin/install_jruby_complete +13 -0
- data/lib/ruby-processing.rb +3 -10
- data/lib/ruby-processing/app.rb +92 -137
- data/lib/ruby-processing/config.rb +14 -3
- data/lib/ruby-processing/exporters/application_exporter.rb +9 -5
- data/lib/ruby-processing/exporters/base_exporter.rb +3 -3
- data/lib/ruby-processing/exporters/creator.rb +4 -4
- data/lib/ruby-processing/exporters/exporters.rb +7 -0
- data/lib/ruby-processing/helper_methods.rb +18 -7
- data/lib/ruby-processing/library_loader.rb +17 -16
- data/lib/ruby-processing/runner.rb +38 -34
- data/lib/ruby-processing/runners/base.rb +1 -13
- data/lib/ruby-processing/runners/run.rb +2 -1
- data/lib/ruby-processing/runners/watch.rb +1 -1
- data/lib/ruby-processing/version.rb +3 -0
- data/lib/templates/application/Contents/Info.plist.erb +2 -2
- data/lib/templates/application/lib/args.txt.erb +1 -1
- data/lib/templates/application/run.erb +2 -1
- data/lib/templates/create/blank_sketch.rb.erb +4 -12
- data/lib/templates/create/p3d_sketch.rb.erb +7 -0
- data/library/boids/boids.rb +76 -58
- data/library/control_panel/control_panel.rb +21 -18
- data/library/file_chooser/file_chooser.rb +90 -0
- data/library/vecmath/vecmath.rb +323 -0
- data/ruby-processing.gemspec +54 -0
- data/samples/contributed/animator.rb +9 -4
- data/samples/contributed/bezier_playground.rb +178 -184
- data/samples/contributed/circle_collision.rb +164 -171
- data/samples/contributed/drawolver.rb +111 -162
- data/samples/contributed/empathy.rb +14 -12
- data/samples/contributed/fern.rb +1 -1
- data/samples/contributed/fibonacci_sphere.rb +125 -0
- data/samples/contributed/flight_patterns.rb +7 -14
- data/samples/contributed/full_screen.rb +4 -6
- data/samples/contributed/grapher.rb +35 -0
- data/samples/contributed/gravity.rb +22 -24
- data/samples/contributed/jwishy.rb +75 -63
- data/samples/contributed/mandelbrot.rb +82 -0
- data/samples/contributed/orbit.rb +5 -4
- data/samples/contributed/pong.rb +152 -150
- data/samples/contributed/quadraticvertex.rb +98 -0
- data/samples/contributed/re_sample.rb +27 -0
- data/samples/contributed/simple_buffer.rb +38 -43
- data/samples/contributed/tree.rb +63 -70
- data/samples/external_library/java_processing/README +3 -0
- data/samples/external_library/java_processing/fisica/README +1 -0
- data/samples/external_library/java_processing/fisica/bubbles.rb +80 -0
- data/samples/external_library/java_processing/fisica/joints.rb +112 -0
- data/samples/external_library/java_processing/fisica/polygons.rb +79 -0
- data/samples/external_library/java_processing/fisica/raycast.rb +61 -0
- data/samples/external_library/java_processing/generative_design/mesh_example.rb +25 -0
- data/samples/external_library/java_processing/generative_design/node_spring_attractor.rb +83 -0
- data/samples/external_library/java_processing/generative_design/sub_class_example.rb +44 -0
- data/samples/external_library/java_processing/geomerative/data/FreeSans.ttf +0 -0
- data/samples/external_library/java_processing/geomerative/data/Toucan.svg +43 -0
- data/samples/external_library/java_processing/geomerative/hello_bot_ignore_styles.rb +38 -0
- data/samples/external_library/java_processing/geomerative/hello_world_rotate_firstletter.rb +43 -0
- data/samples/external_library/java_processing/geomerative/hola_mundo.rb +37 -0
- data/samples/external_library/java_processing/grafica/data/OktoberfestVSGermanElections.csv +118 -0
- data/samples/external_library/java_processing/grafica/default_plot.rb +30 -0
- data/samples/external_library/java_processing/grafica/multiple_panels.rb +117 -0
- data/samples/external_library/java_processing/grafica/oktoberfest_example.rb +83 -0
- data/samples/external_library/java_processing/hemesh/data/java_args.txt +2 -0
- data/samples/external_library/java_processing/hemesh/library/vbo/mesh_to_vbo.rb +43 -0
- data/samples/external_library/java_processing/hemesh/twin_iso.rb +71 -0
- data/samples/external_library/java_processing/pbox2d/bumpy_surface_noise.rb +57 -0
- data/samples/external_library/java_processing/pbox2d/contact_test.rb +23 -0
- data/samples/external_library/java_processing/pbox2d/data/java_args.txt +2 -0
- data/samples/external_library/java_processing/pbox2d/library/custom_shape/custom_shape.rb +158 -0
- data/samples/external_library/java_processing/pbox2d/library/particle_system/particle_system.rb +212 -0
- data/samples/external_library/java_processing/pbox2d/library/surface/surface.rb +154 -0
- data/samples/external_library/java_processing/pbox2d/liquidy.rb +58 -0
- data/samples/external_library/java_processing/pbox2d/polygons.rb +58 -0
- data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/hello_peasy.rb +4 -4
- data/samples/external_library/java_processing/peasy_cam/hilbert_fractal.rb +34 -0
- data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/library/hilbert/hilbert.rb +1 -1
- data/samples/external_library/java_processing/proscene/cad_camera.rb +57 -0
- data/samples/external_library/java_processing/proscene/camera_customization.rb +114 -0
- data/samples/external_library/java_processing/proscene/data/ti_yong.png +0 -0
- data/samples/external_library/java_processing/toxiclibs/data/ti_yong.png +0 -0
- data/samples/external_library/java_processing/toxiclibs/gray_scott_image.rb +79 -0
- data/samples/external_library/java_processing/toxiclibs/gray_scott_tone_map.rb +78 -0
- data/samples/external_library/java_processing/toxiclibs/implicit.rb +143 -0
- data/samples/external_library/java_processing/toxiclibs/library/vbo/mesh_to_vbo.rb +52 -0
- data/samples/external_library/java_processing/toxiclibs/model_align.rb +55 -0
- data/samples/external_library/ruby_gem/README +12 -0
- data/samples/external_library/ruby_gem/data/README.txt +1 -0
- data/samples/external_library/ruby_gem/data/java_args.txt +2 -0
- data/samples/external_library/ruby_gem/game_of_life.rb +127 -0
- data/samples/external_library/ruby_gem/mdarray_test.rb +28 -0
- data/samples/processing_app/basics/arrays/array.rb +23 -29
- data/samples/processing_app/basics/arrays/array_2d.rb +22 -28
- data/samples/processing_app/basics/arrays/array_objects.rb +50 -55
- data/samples/processing_app/basics/camera/move_eye.rb +24 -0
- data/samples/processing_app/{3D → basics}/camera/perspective.rb +0 -0
- data/samples/processing_app/basics/color/brightness.rb +15 -21
- data/samples/processing_app/basics/color/color_wheel.rb +72 -79
- data/samples/processing_app/basics/color/creating.rb +35 -24
- data/samples/processing_app/basics/color/hue.rb +16 -22
- data/samples/processing_app/basics/color/linear_gradient.rb +35 -40
- data/samples/processing_app/basics/color/radial_gradient.rb +26 -34
- data/samples/processing_app/basics/color/reading/reading.rb +2 -7
- data/samples/processing_app/basics/color/relativity.rb +19 -32
- data/samples/processing_app/basics/color/saturation.rb +15 -26
- data/samples/processing_app/basics/color/wave_gradient.rb +25 -36
- data/samples/processing_app/basics/control/conditionals1.rb +20 -25
- data/samples/processing_app/basics/control/conditionals2.rb +27 -32
- data/samples/processing_app/basics/control/embedded_iteration.rb +25 -33
- data/samples/processing_app/basics/control/iteration.rb +43 -54
- data/samples/processing_app/basics/control/logical_operators.rb +45 -48
- data/samples/processing_app/basics/data/characters_strings.rb +50 -0
- data/samples/processing_app/basics/data/datatype_conversion.rb +28 -32
- data/samples/processing_app/basics/data/integers_floats.rb +18 -24
- data/samples/processing_app/basics/data/true_false.rb +19 -25
- data/samples/processing_app/basics/data/variable_scope.rb +51 -57
- data/samples/processing_app/basics/data/variables.rb +27 -32
- data/samples/processing_app/basics/form/bezier.rb +11 -14
- data/samples/processing_app/basics/form/bezier_ellipse.rb +79 -90
- data/samples/processing_app/basics/form/brick_tower.rb +92 -0
- data/samples/processing_app/basics/form/cubic_grid.rb +39 -0
- data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedra.rb +32 -36
- data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedron.rb +1 -1
- data/samples/processing_app/{3D → basics}/form/icosahedra/shape_3D.rb +0 -0
- data/samples/processing_app/basics/form/pie_chart.rb +17 -21
- data/samples/processing_app/basics/form/points_lines.rb +11 -16
- data/samples/processing_app/{3D → basics}/form/primitives.rb +11 -25
- data/samples/processing_app/basics/form/regular_polygon.rb +46 -0
- data/samples/processing_app/basics/form/rgb_cube.rb +68 -0
- data/samples/processing_app/basics/form/shape_primitives.rb +15 -17
- data/samples/processing_app/basics/form/shape_transform.rb +88 -0
- data/samples/processing_app/basics/form/star.rb +48 -0
- data/samples/processing_app/basics/form/toroid.rb +127 -0
- data/samples/processing_app/basics/form/triangle_strip.rb +29 -33
- data/samples/processing_app/basics/form/vertices.rb +36 -40
- data/samples/processing_app/basics/image/alphamask.rb +10 -16
- data/samples/processing_app/basics/image/background_image.rb +16 -22
- data/samples/processing_app/basics/image/create_image.rb +10 -16
- data/samples/processing_app/{3D → basics}/image/data/ystone08.jpg +0 -0
- data/samples/processing_app/basics/image/extrusion.rb +46 -0
- data/samples/processing_app/basics/image/load_display_image.rb +12 -19
- data/samples/processing_app/basics/image/pointillism.rb +13 -19
- data/samples/processing_app/basics/image/request_image.rb +41 -50
- data/samples/processing_app/basics/image/sprite.rb +19 -25
- data/samples/processing_app/basics/image/transparency.rb +14 -20
- data/samples/processing_app/basics/image/zoom.rb +59 -0
- data/samples/processing_app/basics/input/clock.rb +32 -38
- data/samples/processing_app/basics/input/constrain.rb +25 -31
- data/samples/processing_app/basics/input/easing.rb +18 -20
- data/samples/processing_app/basics/input/keyboard.rb +16 -22
- data/samples/processing_app/basics/input/keyboard_functions.rb +49 -68
- data/samples/processing_app/basics/input/milliseconds.rb +11 -16
- data/samples/processing_app/basics/input/mouse_1d.rb +19 -26
- data/samples/processing_app/basics/input/mouse_2d.rb +14 -20
- data/samples/processing_app/basics/input/mouse_functions.rb +56 -61
- data/samples/processing_app/basics/input/mouse_press.rb +9 -15
- data/samples/processing_app/basics/input/mouse_signals.rb +29 -34
- data/samples/processing_app/basics/input/storing_input.rb +28 -29
- data/samples/processing_app/basics/lights/directional.rb +37 -0
- data/samples/processing_app/basics/lights/lights1.rb +35 -0
- data/samples/processing_app/basics/lights/lights2.rb +38 -0
- data/samples/processing_app/basics/lights/reflection.rb +35 -0
- data/samples/processing_app/basics/lights/spot.rb +36 -0
- data/samples/processing_app/basics/math/additive_wave.rb +51 -53
- data/samples/processing_app/basics/math/arctangent.rb +34 -44
- data/samples/processing_app/basics/math/distance1.rb +44 -50
- data/samples/processing_app/basics/math/distance2.rb +14 -30
- data/samples/processing_app/basics/math/double_random.rb +23 -30
- data/samples/processing_app/basics/math/graphing_2_d_equation.rb +30 -44
- data/samples/processing_app/basics/math/increment_decrement.rb +37 -42
- data/samples/processing_app/basics/math/interpolate.rb +34 -0
- data/samples/processing_app/basics/math/modulo.rb +25 -29
- data/samples/processing_app/basics/math/noise_1_d.rb +14 -30
- data/samples/processing_app/basics/math/noise_2_d.rb +22 -39
- data/samples/processing_app/basics/math/noise_3_d.rb +24 -44
- data/samples/processing_app/basics/math/noise_wave.rb +35 -55
- data/samples/processing_app/basics/math/operator_precedence.rb +24 -45
- data/samples/processing_app/basics/math/polar_to_cartesian.rb +22 -35
- data/samples/processing_app/basics/math/random.rb +13 -27
- data/samples/processing_app/basics/math/random_gaussian.rb +23 -0
- data/samples/processing_app/basics/math/sine.rb +27 -41
- data/samples/processing_app/basics/math/sine_cosine.rb +37 -49
- data/samples/processing_app/basics/math/sine_wave.rb +33 -52
- data/samples/processing_app/basics/objects/composite_objects.rb +94 -120
- data/samples/processing_app/basics/objects/inheritance.rb +64 -86
- data/samples/processing_app/basics/objects/multiple_constructors.rb +25 -38
- data/samples/processing_app/basics/objects/objects.rb +42 -57
- data/samples/processing_app/basics/shape/data/rocket.mtl +8 -0
- data/samples/processing_app/basics/shape/data/rocket.obj +1688 -0
- data/samples/processing_app/basics/shape/data/rocket.png +0 -0
- data/samples/processing_app/basics/shape/disable_style.rb +21 -25
- data/samples/processing_app/basics/shape/get_child.rb +27 -30
- data/samples/processing_app/basics/shape/load_display_obj.rb +25 -0
- data/samples/processing_app/basics/shape/load_display_shape.rb +10 -23
- data/samples/processing_app/basics/shape/load_display_svg.rb +22 -0
- data/samples/processing_app/basics/shape/scale_shape.rb +13 -23
- data/samples/processing_app/basics/structure/coordinates.rb +12 -25
- data/samples/processing_app/basics/structure/create_graphics.rb +18 -28
- data/samples/processing_app/basics/structure/functions.rb +19 -31
- data/samples/processing_app/basics/structure/loop.rb +21 -35
- data/samples/processing_app/basics/structure/noloop.rb +13 -25
- data/samples/processing_app/basics/structure/recursion1.rb +18 -33
- data/samples/processing_app/basics/structure/recursion2.rb +18 -34
- data/samples/processing_app/basics/structure/redraw.rb +16 -27
- data/samples/processing_app/basics/structure/setup_draw.rb +11 -22
- data/samples/processing_app/basics/structure/statements_comments.rb +7 -13
- data/samples/processing_app/basics/structure/width_height.rb +7 -14
- data/samples/processing_app/{3D → basics}/textures/data/berlin-1.jpg +0 -0
- data/samples/processing_app/basics/textures/texture1.rb +28 -0
- data/samples/processing_app/basics/textures/texture2.rb +33 -0
- data/samples/processing_app/basics/textures/texture3.rb +64 -0
- data/samples/processing_app/basics/textures/texture_cube.rb +86 -0
- data/samples/processing_app/basics/transform/arm.rb +22 -37
- data/samples/processing_app/basics/transform/bird.rb +57 -0
- data/samples/processing_app/basics/transform/birds.rb +38 -0
- data/samples/processing_app/basics/transform/cubes_in_cube.rb +99 -0
- data/samples/processing_app/{3D/transform/birds → basics/transform/library/bird}/bird.rb +0 -0
- data/samples/processing_app/{3D/transform/cubes_in_cube → basics/transform/library/cube}/cube.rb +10 -12
- data/samples/processing_app/basics/transform/rotate.rb +17 -31
- data/samples/processing_app/basics/transform/rotate1.rb +27 -0
- data/samples/processing_app/basics/transform/rotate_push_pop.rb +35 -0
- data/samples/processing_app/basics/transform/rotate_x_y.rb +36 -0
- data/samples/processing_app/basics/transform/scale.rb +19 -35
- data/samples/processing_app/basics/transform/translate.rb +18 -32
- data/samples/processing_app/basics/transform/triangle_flower.rb +38 -55
- data/samples/processing_app/{3D → basics}/typography/data/Univers45.vlw +0 -0
- data/samples/processing_app/{3D → basics}/typography/kinetic_type.rb +1 -5
- data/samples/processing_app/basics/typography/letters.rb +26 -44
- data/samples/processing_app/basics/typography/words.rb +29 -30
- data/samples/processing_app/basics/web/embedded_links.rb +39 -45
- data/samples/processing_app/basics/web/loading_images.rb +6 -16
- data/samples/processing_app/demos/graphics/bezier_patch.rb +227 -0
- data/samples/processing_app/demos/graphics/data/frag.glsl +30 -0
- data/samples/processing_app/demos/graphics/data/java_args.txt +2 -0
- data/samples/processing_app/demos/graphics/data/mercury.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/planet.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/starfield.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/sun.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/vert.glsl +31 -0
- data/samples/processing_app/demos/graphics/low_level_gl.rb +72 -0
- data/samples/processing_app/demos/graphics/planets.rb +51 -0
- data/samples/processing_app/demos/graphics/trefoil.rb +142 -0
- data/samples/processing_app/demos/graphics/wiggling.rb +289 -0
- data/samples/processing_app/demos/performance/cubic_grid_retained.rb +58 -0
- data/samples/processing_app/demos/performance/data/java_args.txt +1 -0
- data/samples/processing_app/demos/performance/esfera.rb +105 -0
- data/samples/processing_app/demos/performance/text_rendering.rb +14 -0
- data/samples/processing_app/demos/tests/no_background_test.rb +10 -0
- data/samples/processing_app/demos/tests/offscreen_test.rb +34 -0
- data/samples/processing_app/demos/tests/redraw_test.rb +14 -0
- data/samples/processing_app/demos/tests/resize_test.rb +10 -0
- data/samples/processing_app/demos/tests/restart_test.rb +22 -0
- data/samples/processing_app/demos/tests/smooth_test.rb +27 -0
- data/samples/processing_app/demos/tests/specs_test.rb +11 -0
- data/samples/processing_app/library/dxf/simple_export.rb +48 -0
- data/samples/processing_app/library/file_chooser/image_viewer.rb +24 -0
- data/samples/processing_app/library/minim/filter_example.rb +65 -0
- data/samples/processing_app/library/minim/frequency_modulation.rb +64 -0
- data/samples/processing_app/library/minim/sequence_sound.rb +59 -0
- data/samples/processing_app/library/minim/synthesize_sound.rb +35 -0
- data/samples/processing_app/library/movie/README +1 -0
- data/samples/processing_app/library/movie/data/transit.mkv +0 -0
- data/samples/processing_app/library/movie/data/transit.mov +0 -0
- data/samples/processing_app/library/movie/loop.rb +24 -0
- data/samples/processing_app/library/movie/pixelate.rb +50 -0
- data/samples/processing_app/library/movie/reverse.rb +47 -0
- data/samples/processing_app/library/movie/scratch.rb +36 -0
- data/samples/processing_app/library/movie/speed.rb +33 -0
- data/samples/processing_app/library/net/HTTPClient.rb +31 -0
- data/samples/processing_app/library/pdf/.gitignore +1 -0
- data/samples/processing_app/library/pdf/complex_3D.rb +160 -0
- data/samples/processing_app/library/pdf/large_page.rb +25 -0
- data/samples/processing_app/library/pdf/many_frames.rb +33 -0
- data/samples/processing_app/library/pdf/many_pages.rb +31 -0
- data/samples/processing_app/library/pdf/many_pdfs.rb +37 -0
- data/samples/processing_app/library/pdf/one_frame.rb +19 -0
- data/samples/processing_app/library/vecmath/README.txt +2 -0
- data/samples/processing_app/library/vecmath/acceleration_with_vectors.rb +75 -0
- data/samples/processing_app/library/vecmath/bouncing_ball.rb +51 -0
- data/samples/processing_app/library/vecmath/circle_collision.rb +174 -0
- data/samples/processing_app/library/vecmath/data/java_args.txt +2 -0
- data/samples/processing_app/library/vecmath/data/sprite.png +0 -0
- data/samples/processing_app/library/vecmath/data/texture.png +0 -0
- data/samples/processing_app/library/vecmath/drawolver.rb +111 -0
- data/samples/processing_app/library/vecmath/flocking.rb +33 -0
- data/samples/processing_app/library/vecmath/hilbert_fractal.rb +65 -0
- data/samples/processing_app/library/vecmath/library/flock/flock.rb +214 -0
- data/samples/processing_app/library/vecmath/library/hilbert/hilbert.rb +84 -0
- data/samples/processing_app/library/vecmath/library/particle/particle_system.rb +106 -0
- data/samples/processing_app/library/vecmath/library/wiggler/wiggler.rb +58 -0
- data/samples/processing_app/library/vecmath/morph.rb +86 -0
- data/samples/processing_app/library/vecmath/multiple_particle_systems.rb +158 -0
- data/samples/processing_app/library/vecmath/particle_system_pshape.rb +38 -0
- data/samples/processing_app/library/vecmath/reflection1.rb +108 -0
- data/samples/processing_app/library/vecmath/retained_menger.rb +150 -0
- data/samples/processing_app/library/vecmath/retained_test.rb +65 -0
- data/samples/processing_app/library/vecmath/retained_test2.rb +65 -0
- data/samples/processing_app/library/vecmath/simple_particle_system.rb +89 -0
- data/samples/processing_app/library/vecmath/smoke_particle_system.rb +138 -0
- data/samples/processing_app/library/vecmath/vector_math.rb +39 -0
- data/samples/processing_app/library/vecmath/wiggle_pshape.rb +22 -0
- data/samples/processing_app/topics/advanced_data/README +1 -0
- data/samples/processing_app/topics/advanced_data/counting_words.rb +79 -0
- data/samples/processing_app/topics/advanced_data/data/Georgia.ttf +0 -0
- data/samples/processing_app/topics/advanced_data/data/Merriweather-Light.ttf +0 -0
- data/samples/processing_app/topics/advanced_data/data/a000 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a001 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a002 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a003 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a004 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a005 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a006 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a007 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a008 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a009 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a010 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a011 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a012 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a013 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a014 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a015 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a016 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a017 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a018 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a019 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a020 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a021 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a022 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a023 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a024 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a025 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a026 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a027 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a028 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a029 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a030 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a031 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a032 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a033 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a034 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a035 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a036 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a037 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a038 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a039 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a040 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a041 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a042 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a043 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a044 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a045 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a046 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a047 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a048 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a049 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a050 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a051 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a052 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a053 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a054 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a055 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a056 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a057 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a058 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a059 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a060 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a061 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a062 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a063 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a064 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a065 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a066 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a067 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a068 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a069 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a070 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a071 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a072 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a073 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a074 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a075 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a076 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a077 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a078 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a079 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a080 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a081 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a082 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a083 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a084 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a085 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a086 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a087 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a088 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a089 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a090 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a091 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a092 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a093 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a094 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a095 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a096 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a097 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a098 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a099 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a100 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a101 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a102 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a103 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a104 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a105 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a106 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a107 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a108 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a109 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a110 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a111 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a112 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a113 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a114 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a115 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/data.csv +5 -0
- data/samples/processing_app/topics/advanced_data/data/data.json +36 -0
- data/samples/processing_app/topics/advanced_data/data/data.xml +38 -0
- data/samples/processing_app/topics/advanced_data/data/data.yml +22 -0
- data/samples/processing_app/topics/advanced_data/data/dracula.txt +16624 -0
- data/samples/processing_app/topics/advanced_data/data/frankenstein.txt +7652 -0
- data/samples/processing_app/topics/advanced_data/data/struct_data.yml +22 -0
- data/samples/processing_app/topics/advanced_data/library/bubble/bubble.rb +45 -0
- data/samples/processing_app/topics/advanced_data/library/word/word.rb +64 -0
- data/samples/processing_app/topics/advanced_data/load_save_XML.rb +114 -0
- data/samples/processing_app/topics/advanced_data/load_save_json.rb +93 -0
- data/samples/processing_app/topics/advanced_data/load_save_struct_yaml.rb +85 -0
- data/samples/processing_app/topics/advanced_data/load_save_table.rb +85 -0
- data/samples/processing_app/topics/advanced_data/load_save_yaml.rb +89 -0
- data/samples/processing_app/topics/advanced_data/regex.rb +47 -0
- data/samples/processing_app/topics/advanced_data/threads.rb +96 -0
- data/samples/processing_app/topics/advanced_data/threads_two.rb +52 -0
- data/samples/processing_app/topics/advanced_data/word_frequency.rb +78 -0
- data/samples/processing_app/topics/advanced_data/yahoo_weather.rb +38 -0
- data/samples/processing_app/topics/animation/README.txt +1 -0
- data/samples/processing_app/topics/animation/animated_sprite.rb +58 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0011.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0012.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0013.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0014.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0015.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0016.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0017.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0018.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0019.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0020.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0021.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0022.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0023.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0024.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0025.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0026.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0027.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0028.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0029.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0030.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0031.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0032.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0033.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0034.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0035.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0036.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0037.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0011.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0012.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0013.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0014.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0015.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0016.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0017.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0018.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0019.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0020.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0021.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0022.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0023.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0024.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0025.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0026.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0027.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0028.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0029.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0030.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0031.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0032.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0033.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0034.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0035.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0036.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0037.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0038.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0039.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0040.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0041.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0042.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0043.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0044.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0045.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0046.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0047.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0048.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0049.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0050.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0051.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0052.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0053.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0054.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0055.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0056.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0057.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0058.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0059.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0011.gif +0 -0
- data/samples/processing_app/topics/animation/sequential.rb +42 -0
- data/samples/processing_app/topics/cellular_automata/game_of_life.rb +125 -0
- data/samples/processing_app/topics/cellular_automata/library/ca/ca.rb +91 -0
- data/samples/processing_app/topics/cellular_automata/library/cell/cell.rb +99 -0
- data/samples/processing_app/topics/cellular_automata/library/simple_cell/simple_cell.rb +46 -0
- data/samples/processing_app/topics/cellular_automata/spore1.rb +94 -0
- data/samples/processing_app/topics/cellular_automata/spore2.rb +101 -0
- data/samples/processing_app/topics/cellular_automata/wolfram.rb +42 -0
- data/samples/processing_app/topics/create_shapes/begin_end_contour.rb +44 -0
- data/samples/processing_app/topics/create_shapes/data/sprite.png +0 -0
- data/samples/processing_app/topics/create_shapes/group_pshape.rb +69 -0
- data/samples/processing_app/topics/create_shapes/library/particle/particle_system.rb +107 -0
- data/samples/processing_app/topics/create_shapes/library/polygon/polygon.rb +35 -0
- data/samples/processing_app/topics/create_shapes/library/star/star.rb +47 -0
- data/samples/processing_app/topics/create_shapes/library/wiggler/wiggler.rb +57 -0
- data/samples/processing_app/topics/create_shapes/particle_system_pshape.rb +38 -0
- data/samples/processing_app/topics/create_shapes/path_pshape.rb +38 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oo3.rb +56 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb +29 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oop2.rb +52 -0
- data/samples/processing_app/topics/create_shapes/polygon_shape.rb +42 -0
- data/samples/processing_app/topics/create_shapes/primitive_pshape.rb +29 -0
- data/samples/processing_app/topics/create_shapes/wiggle_pshape.rb +22 -0
- data/samples/processing_app/topics/drawing/continuous_lines.rb +17 -0
- data/samples/processing_app/topics/drawing/pattern.rb +30 -0
- data/samples/processing_app/topics/drawing/pulses.rb +33 -0
- data/samples/processing_app/topics/drawing/scribble_plotter.rb +77 -0
- data/samples/processing_app/topics/effects/lens.rb +68 -70
- data/samples/processing_app/topics/file_io/data/positions.txt +206 -0
- data/samples/processing_app/topics/file_io/load_file1.rb +32 -0
- data/samples/processing_app/topics/file_io/save_frames.rb +70 -0
- data/samples/processing_app/topics/file_io/save_one_image.rb +22 -0
- data/samples/processing_app/topics/file_io/tile_images.rb +37 -0
- data/samples/processing_app/topics/gui/button.rb +74 -0
- data/samples/processing_app/topics/gui/data/seedBottom.jpg +0 -0
- data/samples/processing_app/topics/gui/data/seedTop.jpg +0 -0
- data/samples/processing_app/topics/gui/handles.rb +108 -0
- data/samples/processing_app/topics/gui/rollover.rb +63 -0
- data/samples/processing_app/topics/gui/scrollbar.rb +96 -0
- data/samples/processing_app/topics/image_processing/blending.rb +82 -0
- data/samples/processing_app/topics/image_processing/blur.rb +50 -0
- data/samples/processing_app/topics/image_processing/brightness.rb +39 -0
- data/samples/processing_app/topics/image_processing/convolution.rb +72 -0
- data/samples/processing_app/{3D/image → topics/image_processing}/data/eames.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/frontier.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/java_args.txt +3 -0
- data/samples/processing_app/topics/image_processing/data/layer1.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/layer2.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/moon-wide.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/moon.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/sea.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/ystone08.jpg +0 -0
- data/samples/processing_app/topics/image_processing/edge_detection.rb +47 -0
- data/samples/processing_app/topics/image_processing/explode.rb +35 -0
- data/samples/processing_app/topics/image_processing/extrusion.rb +49 -0
- data/samples/processing_app/topics/image_processing/histogram.rb +43 -0
- data/samples/processing_app/topics/image_processing/linear_image.rb +45 -0
- data/samples/processing_app/topics/image_processing/pixel_array.rb +48 -0
- data/samples/processing_app/topics/image_processing/zoom.rb +66 -0
- data/samples/processing_app/topics/lsystems/chequer.rb +72 -0
- data/samples/processing_app/topics/lsystems/csplant.rb +100 -0
- data/samples/processing_app/topics/lsystems/cstest.rb +20 -0
- data/samples/processing_app/topics/lsystems/data/java_args.txt +3 -0
- data/samples/processing_app/topics/lsystems/david_tour.rb +77 -0
- data/samples/processing_app/topics/lsystems/koch.rb +29 -0
- data/samples/processing_app/topics/lsystems/library/cs_grammar/cs_grammar.rb +88 -0
- data/samples/processing_app/topics/lsystems/library/grammar/grammar.rb +33 -0
- data/samples/processing_app/topics/lsystems/library/koch/koch_fractal.rb +117 -0
- data/samples/processing_app/topics/lsystems/library/stochastic_grammar/stochastic_grammar.rb +58 -0
- data/samples/processing_app/topics/lsystems/mpeano.rb +83 -0
- data/samples/processing_app/topics/lsystems/peano.rb +78 -0
- data/samples/processing_app/topics/lsystems/penrose.rb +123 -0
- data/samples/processing_app/topics/lsystems/penrose_snowflake.rb +93 -0
- data/samples/processing_app/topics/lsystems/pentagonal.rb +103 -0
- data/samples/processing_app/topics/lsystems/snake_kolam.rb +93 -0
- data/samples/processing_app/topics/lsystems/stochastic_test.rb +99 -0
- data/samples/processing_app/topics/lsystems/three_d_tree.rb +108 -0
- data/samples/processing_app/topics/motion/bounce.rb +40 -0
- data/samples/processing_app/topics/motion/bouncy_bubbles.rb +96 -0
- data/samples/processing_app/topics/motion/brownian.rb +40 -0
- data/samples/processing_app/topics/motion/circle_collision.rb +185 -0
- data/samples/processing_app/topics/motion/cubes_in_cube.rb +64 -0
- data/samples/processing_app/topics/motion/data/java_args.txt +3 -0
- data/samples/processing_app/topics/motion/library/cube/cube.rb +128 -0
- data/samples/processing_app/topics/motion/library/ground/ground.rb +42 -0
- data/samples/processing_app/topics/motion/linear.rb +25 -0
- data/samples/processing_app/topics/motion/morph.rb +84 -0
- data/samples/processing_app/topics/motion/moving_on_curves.rb +46 -0
- data/samples/processing_app/topics/motion/puff.rb +78 -0
- data/samples/processing_app/topics/motion/reflection1.rb +107 -0
- data/samples/processing_app/topics/motion/reflection2.rb +122 -0
- data/samples/processing_app/topics/shaders/README +1 -0
- data/samples/processing_app/topics/shaders/blur_filter.rb +25 -0
- data/samples/processing_app/topics/shaders/bw_shader.rb +40 -0
- data/samples/processing_app/topics/shaders/conway.rb +26 -0
- data/samples/processing_app/topics/shaders/data/GlossyFrag.glsl +44 -0
- data/samples/processing_app/topics/shaders/data/GlossyVert.glsl +33 -0
- data/samples/processing_app/topics/shaders/data/Texture01.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/Texture02.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/ToonFrag.glsl +25 -0
- data/samples/processing_app/topics/shaders/data/ToonVert.glsl +31 -0
- data/samples/processing_app/topics/shaders/data/blur.glsl +42 -0
- data/samples/processing_app/topics/shaders/data/bwfrag.glsl +23 -0
- data/samples/processing_app/topics/shaders/data/conway.glsl +57 -0
- data/samples/processing_app/topics/shaders/data/cubemapfrag.glsl +1 -0
- data/samples/processing_app/topics/shaders/data/cubemapvert.glsl +1 -0
- data/samples/processing_app/topics/shaders/data/deform.glsl +31 -0
- data/samples/processing_app/topics/shaders/data/displaceFrag.glsl +8 -0
- data/samples/processing_app/topics/shaders/data/displaceVert.glsl +201 -0
- data/samples/processing_app/topics/shaders/data/edges.glsl +40 -0
- data/samples/processing_app/topics/shaders/data/java_args.txt +2 -0
- data/samples/processing_app/topics/shaders/data/lachoy.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/landscape.glsl +352 -0
- data/samples/processing_app/topics/shaders/data/leaves.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/mask.glsl +19 -0
- data/samples/processing_app/topics/shaders/data/monjori.glsl +30 -0
- data/samples/processing_app/topics/shaders/data/nebula.glsl +111 -0
- data/samples/processing_app/topics/shaders/data/sep_blur.glsl +59 -0
- data/samples/processing_app/topics/shaders/data/tex1.jpg +0 -0
- data/samples/processing_app/topics/shaders/deform.rb +28 -0
- data/samples/processing_app/topics/shaders/dome_projection.rb +143 -0
- data/samples/processing_app/topics/shaders/edge_detect.rb +30 -0
- data/samples/processing_app/topics/shaders/glossy_fish_eye.rb +63 -0
- data/samples/processing_app/topics/shaders/glsl_heightmap_noise.rb +122 -0
- data/samples/processing_app/topics/shaders/image_mask.rb +31 -0
- data/samples/processing_app/topics/shaders/landscape.rb +32 -0
- data/samples/processing_app/topics/shaders/monjori.rb +28 -0
- data/samples/processing_app/topics/shaders/nebula.rb +18 -0
- data/samples/processing_app/topics/shaders/sep_blur.rb +64 -0
- data/samples/processing_app/topics/shaders/toon_shading.rb +43 -0
- data/samples/processing_app/topics/simulate/README +1 -0
- data/samples/processing_app/topics/simulate/chain.rb +34 -38
- data/samples/processing_app/topics/simulate/data/java_args.txt +2 -0
- data/samples/processing_app/topics/simulate/data/texture.gif +0 -0
- data/samples/processing_app/topics/simulate/data/texture.png +0 -0
- data/samples/processing_app/topics/simulate/flocking.rb +32 -0
- data/samples/processing_app/topics/simulate/library/flock/flock.rb +206 -0
- data/samples/processing_app/topics/simulate/multiple_particle_systems.rb +122 -110
- data/samples/processing_app/topics/simulate/simple_particle_system.rb +63 -86
- data/samples/processing_app/topics/simulate/smoke_particle_system.rb +136 -0
- data/samples/processing_app/topics/simulate/spring.rb +65 -69
- data/samples/processing_app/topics/simulate/springs.rb +35 -36
- data/samples/processing_app/topics/vectors/acceleration_with_vectors.rb +77 -0
- data/samples/processing_app/topics/vectors/bouncing_ball.rb +49 -0
- data/samples/processing_app/topics/vectors/vector_math.rb +38 -0
- data/test/README.md +6 -0
- data/test/basic.rb +14 -0
- data/test/draw_ex.rb +12 -0
- data/test/graphics.rb +7 -0
- data/test/p2d.rb +14 -0
- data/test/p3d.rb +14 -0
- data/test/rp5_test.rb +77 -0
- data/test/setup_ex.rb +12 -0
- data/vendors/Rakefile +36 -0
- metadata +718 -231
- data/README +0 -64
- data/lib/core/core.jar +0 -0
- data/lib/core/jruby-complete.jar +0 -0
- data/lib/ruby-processing/exporters/applet_exporter.rb +0 -78
- data/lib/templates/applet/images/built_with.jpg +0 -0
- data/lib/templates/applet/images/ruby.jpg +0 -0
- data/lib/templates/applet/images/top.png +0 -0
- data/lib/templates/applet/index.html.erb +0 -113
- data/lib/templates/applet/library/library.txt +0 -1
- data/lib/templates/create/bare_sketch.rb.erb +0 -7
- data/library/dxf/library/dxf.jar +0 -0
- data/library/dxf/library/export.txt +0 -1
- data/library/javascript/library/export.txt +0 -8
- data/library/javascript/library/javascript.jar +0 -0
- data/library/minim/library/export.txt +0 -1
- data/library/minim/library/jl1.0.jar +0 -0
- data/library/minim/library/jsminim.jar +0 -0
- data/library/minim/library/minim-spi.jar +0 -0
- data/library/minim/library/minim.jar +0 -0
- data/library/minim/library/mp3spi1.9.4.jar +0 -0
- data/library/minim/library/tritonus_aos.jar +0 -0
- data/library/minim/library/tritonus_share.jar +0 -0
- data/library/net/library/export.txt +0 -1
- data/library/net/library/net.jar +0 -0
- data/library/opengl/library/export.txt +0 -10
- data/library/opengl/library/gluegen-rt.jar +0 -0
- data/library/opengl/library/jogl.jar +0 -0
- data/library/opengl/library/linux32/libgluegen-rt.so +0 -0
- data/library/opengl/library/linux32/libjogl.so +0 -0
- data/library/opengl/library/linux32/libjogl_awt.so +0 -0
- data/library/opengl/library/linux32/libjogl_cg.so +0 -0
- data/library/opengl/library/linux64/libgluegen-rt.so +0 -0
- data/library/opengl/library/linux64/libjogl.so +0 -0
- data/library/opengl/library/linux64/libjogl_awt.so +0 -0
- data/library/opengl/library/linux64/libjogl_cg.so +0 -0
- data/library/opengl/library/macosx/libgluegen-rt.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl_awt.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl_cg.jnilib +0 -0
- data/library/opengl/library/opengl.jar +0 -0
- data/library/opengl/library/windows32/gluegen-rt.dll +0 -0
- data/library/opengl/library/windows32/jogl.dll +0 -0
- data/library/opengl/library/windows32/jogl_awt.dll +0 -0
- data/library/opengl/library/windows32/jogl_cg.dll +0 -0
- data/library/opengl/library/windows64/gluegen-rt.dll +0 -0
- data/library/opengl/library/windows64/jogl.dll +0 -0
- data/library/opengl/library/windows64/jogl_awt.dll +0 -0
- data/library/opengl/library/windows64/jogl_cg.dll +0 -0
- data/library/pdf/library/export.txt +0 -1
- data/library/pdf/library/itext.jar +0 -0
- data/library/pdf/library/pdf.jar +0 -0
- data/library/serial/library/RXTXcomm.jar +0 -0
- data/library/serial/library/export.txt +0 -1
- data/library/serial/library/linux32/librxtxSerial.so +0 -0
- data/library/serial/library/linux64/librxtxSerial.so +0 -0
- data/library/serial/library/macosx/librxtxSerial.jnilib +0 -0
- data/library/serial/library/serial.jar +0 -0
- data/library/serial/library/windows32/rxtxSerial.dll +0 -0
- data/library/serial/library/windows64/rxtxSerial.dll +0 -0
- data/library/video/library/export.txt +0 -1
- data/library/video/library/video.jar +0 -0
- data/samples/anar/data/java_args.txt +0 -1
- data/samples/anar/extrusion.rb +0 -49
- data/samples/anar/l_system.rb +0 -86
- data/samples/anar/library/anar/anar.jar +0 -0
- data/samples/anar/many_shapes.rb +0 -98
- data/samples/peasy_cam/data/java_args.txt +0 -1
- data/samples/peasy_cam/hilbert_fractal.rb +0 -40
- data/samples/peasy_cam/library/PeasyCam/PeasyCam.jar +0 -0
- data/samples/processing_app/3D/camera/move_eye.rb +0 -29
- data/samples/processing_app/3D/camera/ortho_vs_perspective.rb +0 -38
- data/samples/processing_app/3D/form/brick_tower.rb +0 -86
- data/samples/processing_app/3D/form/cubic_grid.rb +0 -51
- data/samples/processing_app/3D/form/rgb_cube.rb +0 -88
- data/samples/processing_app/3D/form/shape_transform.rb +0 -94
- data/samples/processing_app/3D/form/toroid.rb +0 -130
- data/samples/processing_app/3D/form/vertices.rb +0 -81
- data/samples/processing_app/3D/image/explode.rb +0 -56
- data/samples/processing_app/3D/image/extrusion.rb +0 -49
- data/samples/processing_app/3D/image/zoom.rb +0 -83
- data/samples/processing_app/3D/lights/directional.rb +0 -41
- data/samples/processing_app/3D/lights/lights1.rb +0 -39
- data/samples/processing_app/3D/lights/lights2.rb +0 -42
- data/samples/processing_app/3D/lights/reflection.rb +0 -38
- data/samples/processing_app/3D/lights/spot.rb +0 -39
- data/samples/processing_app/3D/textures/texture1.rb +0 -41
- data/samples/processing_app/3D/textures/texture2.rb +0 -38
- data/samples/processing_app/3D/textures/texture3.rb +0 -68
- data/samples/processing_app/3D/textures/texture_cube.rb +0 -106
- data/samples/processing_app/3D/transform/bird.rb +0 -61
- data/samples/processing_app/3D/transform/birds/birds.rb +0 -48
- data/samples/processing_app/3D/transform/cubes_in_cube/cubes_in_cube.rb +0 -102
- data/samples/processing_app/3D/transform/push_pop_cubes.rb +0 -152
- data/samples/processing_app/3D/transform/rotate1.rb +0 -43
- data/samples/processing_app/3D/transform/rotate2.rb +0 -45
- data/samples/processing_app/3D/typography/data/Univers66.vlw.gz +0 -0
- data/samples/processing_app/3D/typography/letter_k.rb +0 -136
- data/samples/processing_app/3D/typography/typing.rb +0 -77
- data/samples/processing_app/basics/data/characters_strings/characters_strings.rb +0 -85
- data/samples/processing_app/basics/data/characters_strings/data/Eureka-90.vlw +0 -0
- data/samples/processing_app/basics/data/characters_strings/data/rathausFrog.jpg +0 -0
- data/samples/processing_app/basics/input/keyboard_2.rb +0 -45
@@ -0,0 +1,42 @@
|
|
1
|
+
#ifdef GL_ES
|
2
|
+
precision mediump float;
|
3
|
+
precision mediump int;
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#define PROCESSING_TEXTURE_SHADER
|
7
|
+
|
8
|
+
uniform sampler2D texture;
|
9
|
+
uniform vec2 texOffset;
|
10
|
+
|
11
|
+
varying vec4 vertColor;
|
12
|
+
varying vec4 vertTexCoord;
|
13
|
+
|
14
|
+
void main(void) {
|
15
|
+
// Grouping texcoord variables in order to make it work in the GMA 950. See post #13
|
16
|
+
// in this thread:
|
17
|
+
// http://www.idevgames.com/forums/thread-3467.html
|
18
|
+
vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t);
|
19
|
+
vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t);
|
20
|
+
vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t);
|
21
|
+
vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0);
|
22
|
+
vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0);
|
23
|
+
vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0);
|
24
|
+
vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t);
|
25
|
+
vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t);
|
26
|
+
vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t);
|
27
|
+
|
28
|
+
vec4 col0 = texture2D(texture, tc0);
|
29
|
+
vec4 col1 = texture2D(texture, tc1);
|
30
|
+
vec4 col2 = texture2D(texture, tc2);
|
31
|
+
vec4 col3 = texture2D(texture, tc3);
|
32
|
+
vec4 col4 = texture2D(texture, tc4);
|
33
|
+
vec4 col5 = texture2D(texture, tc5);
|
34
|
+
vec4 col6 = texture2D(texture, tc6);
|
35
|
+
vec4 col7 = texture2D(texture, tc7);
|
36
|
+
vec4 col8 = texture2D(texture, tc8);
|
37
|
+
|
38
|
+
vec4 sum = (1.0 * col0 + 2.0 * col1 + 1.0 * col2 +
|
39
|
+
2.0 * col3 + 4.0 * col4 + 2.0 * col5 +
|
40
|
+
1.0 * col6 + 2.0 * col7 + 1.0 * col8) / 16.0;
|
41
|
+
gl_FragColor = vec4(sum.rgb, 1.0) * vertColor;
|
42
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#ifdef GL_ES
|
2
|
+
precision mediump float;
|
3
|
+
precision mediump int;
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#define PROCESSING_TEXTURE_SHADER
|
7
|
+
|
8
|
+
uniform sampler2D texture;
|
9
|
+
|
10
|
+
varying vec4 vertColor;
|
11
|
+
varying vec4 vertTexCoord;
|
12
|
+
|
13
|
+
const vec4 lumcoeff = vec4(0.299, 0.587, 0.114, 0);
|
14
|
+
|
15
|
+
void main() {
|
16
|
+
vec4 col = texture2D(texture, vertTexCoord.st);
|
17
|
+
float lum = dot(col, lumcoeff);
|
18
|
+
if (0.5 < lum) {
|
19
|
+
gl_FragColor = vertColor;
|
20
|
+
} else {
|
21
|
+
gl_FragColor = vec4(0, 0, 0, 1);
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// Conway's game of life
|
2
|
+
|
3
|
+
#ifdef GL_ES
|
4
|
+
precision highp float;
|
5
|
+
#endif
|
6
|
+
|
7
|
+
#define PROCESSING_COLOR_SHADER
|
8
|
+
|
9
|
+
uniform float time;
|
10
|
+
uniform vec2 mouse;
|
11
|
+
uniform vec2 resolution;
|
12
|
+
uniform sampler2D buffer;
|
13
|
+
|
14
|
+
vec4 live = vec4(0.5,1.0,0.7,1.);
|
15
|
+
vec4 dead = vec4(0.,0.,0.,1.);
|
16
|
+
vec4 blue = vec4(0.,0.,1.,1.);
|
17
|
+
|
18
|
+
void main( void ) {
|
19
|
+
vec2 position = ( gl_FragCoord.xy / resolution.xy );
|
20
|
+
vec2 pixel = 1./resolution;
|
21
|
+
|
22
|
+
if (length(position-mouse) < 0.01) {
|
23
|
+
float rnd1 = mod(fract(sin(dot(position + time * 0.001, vec2(14.9898,78.233))) * 43758.5453), 1.0);
|
24
|
+
if (rnd1 > 0.5) {
|
25
|
+
gl_FragColor = live;
|
26
|
+
} else {
|
27
|
+
gl_FragColor = blue;
|
28
|
+
}
|
29
|
+
} else {
|
30
|
+
float sum = 0.;
|
31
|
+
sum += texture2D(buffer, position + pixel * vec2(-1., -1.)).g;
|
32
|
+
sum += texture2D(buffer, position + pixel * vec2(-1., 0.)).g;
|
33
|
+
sum += texture2D(buffer, position + pixel * vec2(-1., 1.)).g;
|
34
|
+
sum += texture2D(buffer, position + pixel * vec2(1., -1.)).g;
|
35
|
+
sum += texture2D(buffer, position + pixel * vec2(1., 0.)).g;
|
36
|
+
sum += texture2D(buffer, position + pixel * vec2(1., 1.)).g;
|
37
|
+
sum += texture2D(buffer, position + pixel * vec2(0., -1.)).g;
|
38
|
+
sum += texture2D(buffer, position + pixel * vec2(0., 1.)).g;
|
39
|
+
vec4 me = texture2D(buffer, position);
|
40
|
+
|
41
|
+
if (me.g <= 0.1) {
|
42
|
+
if ((sum >= 2.9) && (sum <= 3.1)) {
|
43
|
+
gl_FragColor = live;
|
44
|
+
} else if (me.b > 0.004) {
|
45
|
+
gl_FragColor = vec4(0., 0., max(me.b - 0.004, 0.25), 0.);
|
46
|
+
} else {
|
47
|
+
gl_FragColor = dead;
|
48
|
+
}
|
49
|
+
} else {
|
50
|
+
if ((sum >= 1.9) && (sum <= 3.1)) {
|
51
|
+
gl_FragColor = live;
|
52
|
+
} else {
|
53
|
+
gl_FragColor = blue;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
uniform mat4 transform;
|
2
|
gl_Position = transform * vertex;
|
1
3
|
|
2
4
|
vec3 ecNormal = normalize(normalMatrix * normal); // Vertex in eye coordinates
|
3
5
|
vec3 ecVertex = vec3(modelview * vertex); // Normal vector in eye coordinates
|
4
6
|
vec3 eyeDir = ecVertex.xyz;
|
5
7
|
reflectDir = reflect(eyeDir, ecNormal);
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#ifdef GL_ES
|
2
|
+
precision mediump float;
|
3
|
+
precision mediump int;
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#define PROCESSING_TEXTURE_SHADER
|
7
|
+
|
8
|
+
uniform sampler2D texture;
|
9
|
+
|
10
|
+
uniform float time;
|
11
|
+
uniform vec2 resolution;
|
12
|
+
uniform vec2 mouse;
|
13
|
+
|
14
|
+
void main(void) {
|
15
|
+
vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy;
|
16
|
+
vec2 m = -1.0 + 2.0 * mouse.xy / resolution.xy;
|
17
|
+
|
18
|
+
float a1 = atan(p.y - m.y, p.x - m.x);
|
19
|
+
float r1 = sqrt(dot(p - m, p - m));
|
20
|
+
float a2 = atan(p.y + m.y, p.x + m.x);
|
21
|
+
float r2 = sqrt(dot(p + m, p + m));
|
22
|
+
|
23
|
+
vec2 uv;
|
24
|
+
uv.x = 0.2 * time + (r1 - r2) * 0.25;
|
25
|
+
uv.y = sin(2.0 * (a1 - a2));
|
26
|
+
|
27
|
+
float w = r1 * r2 * 0.8;
|
28
|
+
vec3 col = texture2D(texture, 0.5 - 0.495 * uv).xyz;
|
29
|
+
|
30
|
+
gl_FragColor = vec4(col / (0.1 + w), 1.0);
|
31
|
+
}
|
@@ -0,0 +1,201 @@
|
|
1
|
+
|
2
|
+
#define PROCESSING_TEXLIGHT_SHADER
|
3
|
+
|
4
|
+
uniform mat4 modelview;
|
5
|
+
uniform mat4 transform;
|
6
|
+
uniform mat3 normalMatrix;
|
7
|
+
uniform mat4 texMatrix;
|
8
|
+
|
9
|
+
uniform int lightCount;
|
10
|
+
uniform vec4 lightPosition[8];
|
11
|
+
uniform vec3 lightNormal[8];
|
12
|
+
uniform vec3 lightAmbient[8];
|
13
|
+
uniform vec3 lightDiffuse[8];
|
14
|
+
uniform vec3 lightSpecular[8];
|
15
|
+
uniform vec3 lightFalloff[8];
|
16
|
+
uniform vec2 lightSpot[8];
|
17
|
+
|
18
|
+
attribute vec4 vertex;
|
19
|
+
attribute vec4 color;
|
20
|
+
attribute vec3 normal;
|
21
|
+
attribute vec2 texCoord;
|
22
|
+
|
23
|
+
attribute vec4 ambient;
|
24
|
+
attribute vec4 specular;
|
25
|
+
attribute vec4 emissive;
|
26
|
+
attribute float shininess;
|
27
|
+
|
28
|
+
varying vec4 vertColor;
|
29
|
+
varying vec4 vertTexCoord;
|
30
|
+
|
31
|
+
const float zero_float = 0.0;
|
32
|
+
const float one_float = 1.0;
|
33
|
+
const vec3 zero_vec3 = vec3(0);
|
34
|
+
|
35
|
+
uniform float displaceStrength;
|
36
|
+
uniform float time;
|
37
|
+
|
38
|
+
float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
|
39
|
+
vec3 lpv = lightPos - vertPos;
|
40
|
+
vec3 dist = vec3(one_float);
|
41
|
+
dist.z = dot(lpv, lpv);
|
42
|
+
dist.y = sqrt(dist.z);
|
43
|
+
return one_float / dot(dist, coeff);
|
44
|
+
}
|
45
|
+
|
46
|
+
float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
|
47
|
+
vec3 lpv = normalize(lightPos - vertPos);
|
48
|
+
vec3 nln = -one_float * lightNorm;
|
49
|
+
float spotCos = dot(nln, lpv);
|
50
|
+
return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
|
51
|
+
}
|
52
|
+
|
53
|
+
float lambertFactor(vec3 lightDir, vec3 vecNormal) {
|
54
|
+
return max(zero_float, dot(lightDir, vecNormal));
|
55
|
+
}
|
56
|
+
|
57
|
+
float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
|
58
|
+
vec3 np = normalize(vertPos);
|
59
|
+
vec3 ldp = normalize(lightDir - np);
|
60
|
+
return pow(max(zero_float, dot(ldp, vecNormal)), shine);
|
61
|
+
}
|
62
|
+
|
63
|
+
// Source code for GLSL Perlin noise courtesy of:
|
64
|
+
// https://github.com/ashima/webgl-noise/wiki
|
65
|
+
|
66
|
+
vec3 mod289(vec3 x) {
|
67
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
68
|
+
}
|
69
|
+
|
70
|
+
vec2 mod289(vec2 x) {
|
71
|
+
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
72
|
+
}
|
73
|
+
|
74
|
+
vec3 permute(vec3 x) {
|
75
|
+
return mod289(((x*34.0)+1.0)*x);
|
76
|
+
}
|
77
|
+
|
78
|
+
float snoise(vec2 v)
|
79
|
+
{
|
80
|
+
const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0
|
81
|
+
0.366025403784439, // 0.5*(sqrt(3.0)-1.0)
|
82
|
+
-0.577350269189626, // -1.0 + 2.0 * C.x
|
83
|
+
0.024390243902439); // 1.0 / 41.0
|
84
|
+
// First corner
|
85
|
+
vec2 i = floor(v + dot(v, C.yy) );
|
86
|
+
vec2 x0 = v - i + dot(i, C.xx);
|
87
|
+
|
88
|
+
// Other corners
|
89
|
+
vec2 i1;
|
90
|
+
//i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0
|
91
|
+
//i1.y = 1.0 - i1.x;
|
92
|
+
i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
|
93
|
+
// x0 = x0 - 0.0 + 0.0 * C.xx ;
|
94
|
+
// x1 = x0 - i1 + 1.0 * C.xx ;
|
95
|
+
// x2 = x0 - 1.0 + 2.0 * C.xx ;
|
96
|
+
vec4 x12 = x0.xyxy + C.xxzz;
|
97
|
+
x12.xy -= i1;
|
98
|
+
|
99
|
+
// Permutations
|
100
|
+
i = mod289(i); // Avoid truncation effects in permutation
|
101
|
+
vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))
|
102
|
+
+ i.x + vec3(0.0, i1.x, 1.0 ));
|
103
|
+
|
104
|
+
vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
|
105
|
+
m = m*m ;
|
106
|
+
m = m*m ;
|
107
|
+
|
108
|
+
// Gradients: 41 points uniformly over a line, mapped onto a diamond.
|
109
|
+
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)
|
110
|
+
|
111
|
+
vec3 x = 2.0 * fract(p * C.www) - 1.0;
|
112
|
+
vec3 h = abs(x) - 0.5;
|
113
|
+
vec3 ox = floor(x + 0.5);
|
114
|
+
vec3 a0 = x - ox;
|
115
|
+
|
116
|
+
// Normalise gradients implicitly by scaling m
|
117
|
+
// Approximation of: m *= inversesqrt( a0*a0 + h*h );
|
118
|
+
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );
|
119
|
+
|
120
|
+
// Compute final noise value at P
|
121
|
+
vec3 g;
|
122
|
+
g.x = a0.x * x0.x + h.x * x0.y;
|
123
|
+
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
|
124
|
+
return 130.0 * dot(m, g);
|
125
|
+
}
|
126
|
+
|
127
|
+
void main() {
|
128
|
+
// Calculating texture coordinates, with r and q set both to one
|
129
|
+
vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
|
130
|
+
|
131
|
+
vec2 p = texCoord; // put coordinates into vec2 p for convenience
|
132
|
+
p.x += time; // add time to make the noise and the subsequent displacement move
|
133
|
+
float df = snoise( p ); // create displacement float value from shader-based 2D Perlin noise
|
134
|
+
vec4 newVertexPos = vertex + vec4(normal * df * displaceStrength, 0.0); // regular vertex position + direction * displacementMap * displaceStrength
|
135
|
+
|
136
|
+
// Vertex in clip coordinates
|
137
|
+
gl_Position = transform * newVertexPos;
|
138
|
+
|
139
|
+
// Vertex in eye coordinates
|
140
|
+
vec3 ecVertex = vec3(modelview * vertex);
|
141
|
+
|
142
|
+
// Normal vector in eye coordinates
|
143
|
+
vec3 ecNormal = normalize(normalMatrix * normal);
|
144
|
+
|
145
|
+
if (dot(-one_float * ecVertex, ecNormal) < zero_float) {
|
146
|
+
// If normal is away from camera, choose its opposite.
|
147
|
+
// If we add backface culling, this will be backfacing
|
148
|
+
ecNormal *= -one_float;
|
149
|
+
}
|
150
|
+
|
151
|
+
// Light calculations
|
152
|
+
vec3 totalAmbient = vec3(0, 0, 0);
|
153
|
+
vec3 totalDiffuse = vec3(0, 0, 0);
|
154
|
+
vec3 totalSpecular = vec3(0, 0, 0);
|
155
|
+
for (int i = 0; i < 8; i++) {
|
156
|
+
if (lightCount == i) break;
|
157
|
+
|
158
|
+
vec3 lightPos = lightPosition[i].xyz;
|
159
|
+
bool isDir = zero_float < lightPosition[i].w;
|
160
|
+
float spotCos = lightSpot[i].x;
|
161
|
+
float spotExp = lightSpot[i].y;
|
162
|
+
|
163
|
+
vec3 lightDir;
|
164
|
+
float falloff;
|
165
|
+
float spotf;
|
166
|
+
|
167
|
+
if (isDir) {
|
168
|
+
falloff = one_float;
|
169
|
+
lightDir = -one_float * lightNormal[i];
|
170
|
+
} else {
|
171
|
+
falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
|
172
|
+
lightDir = normalize(lightPos - ecVertex);
|
173
|
+
}
|
174
|
+
|
175
|
+
spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
|
176
|
+
spotCos, spotExp)
|
177
|
+
: one_float;
|
178
|
+
|
179
|
+
if (any(greaterThan(lightAmbient[i], zero_vec3))) {
|
180
|
+
totalAmbient += lightAmbient[i] * falloff;
|
181
|
+
}
|
182
|
+
|
183
|
+
if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
|
184
|
+
totalDiffuse += lightDiffuse[i] * falloff * spotf *
|
185
|
+
lambertFactor(lightDir, ecNormal);
|
186
|
+
}
|
187
|
+
|
188
|
+
if (any(greaterThan(lightSpecular[i], zero_vec3))) {
|
189
|
+
totalSpecular += lightSpecular[i] * falloff * spotf *
|
190
|
+
blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
// Calculating final color as result of all lights (plus emissive term).
|
195
|
+
// Transparency is determined exclusively by the diffuse component.
|
196
|
+
vertColor = vec4(totalAmbient, 0) * ambient +
|
197
|
+
vec4(totalDiffuse, 1) * color +
|
198
|
+
vec4(totalSpecular, 0) * specular +
|
199
|
+
vec4(emissive.rgb, 0);
|
200
|
+
|
201
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#ifdef GL_ES
|
2
|
+
precision mediump float;
|
3
|
+
precision mediump int;
|
4
|
+
#endif
|
5
|
+
|
6
|
+
#define PROCESSING_TEXTURE_SHADER
|
7
|
+
|
8
|
+
uniform sampler2D texture;
|
9
|
+
uniform vec2 texOffset;
|
10
|
+
|
11
|
+
varying vec4 vertColor;
|
12
|
+
varying vec4 vertTexCoord;
|
13
|
+
|
14
|
+
void main(void) {
|
15
|
+
// Grouping texcoord variables in order to make it work in the GMA 950. See post #13
|
16
|
+
// in this thread:
|
17
|
+
// http://www.idevgames.com/forums/thread-3467.html
|
18
|
+
vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t);
|
19
|
+
vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t);
|
20
|
+
vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t);
|
21
|
+
vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0);
|
22
|
+
vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0);
|
23
|
+
vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0);
|
24
|
+
vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t);
|
25
|
+
vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t);
|
26
|
+
vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t);
|
27
|
+
|
28
|
+
vec4 col0 = texture2D(texture, tc0);
|
29
|
+
vec4 col1 = texture2D(texture, tc1);
|
30
|
+
vec4 col2 = texture2D(texture, tc2);
|
31
|
+
vec4 col3 = texture2D(texture, tc3);
|
32
|
+
vec4 col4 = texture2D(texture, tc4);
|
33
|
+
vec4 col5 = texture2D(texture, tc5);
|
34
|
+
vec4 col6 = texture2D(texture, tc6);
|
35
|
+
vec4 col7 = texture2D(texture, tc7);
|
36
|
+
vec4 col8 = texture2D(texture, tc8);
|
37
|
+
|
38
|
+
vec4 sum = 8.0 * col4 - (col0 + col1 + col2 + col3 + col5 + col6 + col7 + col8);
|
39
|
+
gl_FragColor = vec4(sum.rgb, 1.0) * vertColor;
|
40
|
+
}
|
Binary file
|
@@ -0,0 +1,352 @@
|
|
1
|
+
// Elevated shader
|
2
|
+
// https://www.shadertoy.com/view/MdX3Rr by inigo quilez
|
3
|
+
|
4
|
+
// Created by inigo quilez - iq/2013
|
5
|
+
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
|
6
|
+
|
7
|
+
// Processing port by Raphaël de Courville.
|
8
|
+
|
9
|
+
#ifdef GL_ES
|
10
|
+
precision highp float;
|
11
|
+
#endif
|
12
|
+
|
13
|
+
// Type of shader expected by Processing
|
14
|
+
#define PROCESSING_COLOR_SHADER
|
15
|
+
|
16
|
+
// Processing specific input
|
17
|
+
uniform float time;
|
18
|
+
uniform vec2 resolution;
|
19
|
+
uniform vec2 mouse;
|
20
|
+
|
21
|
+
// Layer between Processing and Shadertoy uniforms
|
22
|
+
vec3 iResolution = vec3(resolution,0.0);
|
23
|
+
float iGlobalTime = time;
|
24
|
+
vec4 iMouse = vec4(mouse,0.0,0.0); // zw would normally be the click status
|
25
|
+
|
26
|
+
// ------- Below is the unmodified Shadertoy code ----------
|
27
|
+
// Created by inigo quilez - iq/2013
|
28
|
+
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
|
29
|
+
|
30
|
+
//stereo thanks to Croqueteer
|
31
|
+
//#define STEREO
|
32
|
+
|
33
|
+
mat3 m = mat3( 0.00, 0.80, 0.60,
|
34
|
+
-0.80, 0.36, -0.48,
|
35
|
+
-0.60, -0.48, 0.64 );
|
36
|
+
|
37
|
+
float hash( float n )
|
38
|
+
{
|
39
|
+
return fract(sin(n)*43758.5453123);
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
float noise( in vec3 x )
|
44
|
+
{
|
45
|
+
vec3 p = floor(x);
|
46
|
+
vec3 f = fract(x);
|
47
|
+
|
48
|
+
f = f*f*(3.0-2.0*f);
|
49
|
+
|
50
|
+
float n = p.x + p.y*57.0 + 113.0*p.z;
|
51
|
+
|
52
|
+
float res = mix(mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
|
53
|
+
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y),
|
54
|
+
mix(mix( hash(n+113.0), hash(n+114.0),f.x),
|
55
|
+
mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
|
56
|
+
return res;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
vec3 noised( in vec2 x )
|
63
|
+
{
|
64
|
+
vec2 p = floor(x);
|
65
|
+
vec2 f = fract(x);
|
66
|
+
|
67
|
+
vec2 u = f*f*(3.0-2.0*f);
|
68
|
+
|
69
|
+
float n = p.x + p.y*57.0;
|
70
|
+
|
71
|
+
float a = hash(n+ 0.0);
|
72
|
+
float b = hash(n+ 1.0);
|
73
|
+
float c = hash(n+ 57.0);
|
74
|
+
float d = hash(n+ 58.0);
|
75
|
+
return vec3(a+(b-a)*u.x+(c-a)*u.y+(a-b-c+d)*u.x*u.y,
|
76
|
+
30.0*f*f*(f*(f-2.0)+1.0)*(vec2(b-a,c-a)+(a-b-c+d)*u.yx));
|
77
|
+
|
78
|
+
}
|
79
|
+
|
80
|
+
float noise( in vec2 x )
|
81
|
+
{
|
82
|
+
vec2 p = floor(x);
|
83
|
+
vec2 f = fract(x);
|
84
|
+
|
85
|
+
f = f*f*(3.0-2.0*f);
|
86
|
+
|
87
|
+
float n = p.x + p.y*57.0;
|
88
|
+
|
89
|
+
float res = mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
|
90
|
+
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y);
|
91
|
+
|
92
|
+
return res;
|
93
|
+
}
|
94
|
+
|
95
|
+
float fbm( vec3 p )
|
96
|
+
{
|
97
|
+
float f = 0.0;
|
98
|
+
|
99
|
+
f += 0.5000*noise( p ); p = m*p*2.02;
|
100
|
+
f += 0.2500*noise( p ); p = m*p*2.03;
|
101
|
+
f += 0.1250*noise( p ); p = m*p*2.01;
|
102
|
+
f += 0.0625*noise( p );
|
103
|
+
|
104
|
+
return f/0.9375;
|
105
|
+
}
|
106
|
+
|
107
|
+
mat2 m2 = mat2(1.6,-1.2,1.2,1.6);
|
108
|
+
|
109
|
+
float fbm( vec2 p )
|
110
|
+
{
|
111
|
+
float f = 0.0;
|
112
|
+
|
113
|
+
f += 0.5000*noise( p ); p = m2*p*2.02;
|
114
|
+
f += 0.2500*noise( p ); p = m2*p*2.03;
|
115
|
+
f += 0.1250*noise( p ); p = m2*p*2.01;
|
116
|
+
f += 0.0625*noise( p );
|
117
|
+
|
118
|
+
return f/0.9375;
|
119
|
+
}
|
120
|
+
|
121
|
+
float terrain( in vec2 x )
|
122
|
+
{
|
123
|
+
vec2 p = x*0.003;
|
124
|
+
float a = 0.0;
|
125
|
+
float b = 1.0;
|
126
|
+
vec2 d = vec2(0.0);
|
127
|
+
for(int i=0;i<5; i++)
|
128
|
+
{
|
129
|
+
vec3 n = noised(p);
|
130
|
+
d += n.yz;
|
131
|
+
a += b*n.x/(1.0+dot(d,d));
|
132
|
+
b *= 0.5;
|
133
|
+
p=mat2(1.6,-1.2,1.2,1.6)*p;
|
134
|
+
}
|
135
|
+
|
136
|
+
return 140.0*a;
|
137
|
+
}
|
138
|
+
|
139
|
+
float terrain2( in vec2 x )
|
140
|
+
{
|
141
|
+
vec2 p = x*0.003;
|
142
|
+
float a = 0.0;
|
143
|
+
float b = 1.0;
|
144
|
+
vec2 d = vec2(0.0);
|
145
|
+
for(int i=0;i<14; i++)
|
146
|
+
{
|
147
|
+
vec3 n = noised(p);
|
148
|
+
d += n.yz;
|
149
|
+
a += b*n.x/(1.0+dot(d,d));
|
150
|
+
b *= 0.5;
|
151
|
+
p=m2*p;
|
152
|
+
}
|
153
|
+
|
154
|
+
return 140.0*a;
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
float map( in vec3 p )
|
159
|
+
{
|
160
|
+
float h = terrain(p.xz);
|
161
|
+
|
162
|
+
float ss = 0.03;
|
163
|
+
float hh = h*ss;
|
164
|
+
float fh = fract(hh);
|
165
|
+
float ih = floor(hh);
|
166
|
+
fh = mix( sqrt(fh), fh, smoothstep(50.0,140.0,h) );
|
167
|
+
h = (ih+fh)/ss;
|
168
|
+
|
169
|
+
return p.y - h;
|
170
|
+
}
|
171
|
+
|
172
|
+
float map2( in vec3 p )
|
173
|
+
{
|
174
|
+
float h = terrain2(p.xz);
|
175
|
+
|
176
|
+
|
177
|
+
float ss = 0.03;
|
178
|
+
float hh = h*ss;
|
179
|
+
float fh = fract(hh);
|
180
|
+
float ih = floor(hh);
|
181
|
+
fh = mix( sqrt(fh), fh, smoothstep(50.0,140.0,h) );
|
182
|
+
h = (ih+fh)/ss;
|
183
|
+
|
184
|
+
return p.y - h;
|
185
|
+
}
|
186
|
+
|
187
|
+
bool jinteresct(in vec3 rO, in vec3 rD, out float resT )
|
188
|
+
{
|
189
|
+
float h = 0.0;
|
190
|
+
float t = 0.0;
|
191
|
+
for( int j=0; j<120; j++ )
|
192
|
+
{
|
193
|
+
//if( t>2000.0 ) break;
|
194
|
+
|
195
|
+
vec3 p = rO + t*rD;
|
196
|
+
if( p.y>300.0 ) break;
|
197
|
+
h = map( p );
|
198
|
+
|
199
|
+
if( h<0.1 )
|
200
|
+
{
|
201
|
+
resT = t;
|
202
|
+
return true;
|
203
|
+
}
|
204
|
+
t += max(0.1,0.5*h);
|
205
|
+
|
206
|
+
}
|
207
|
+
|
208
|
+
if( h<5.0 )
|
209
|
+
{
|
210
|
+
resT = t;
|
211
|
+
return true;
|
212
|
+
}
|
213
|
+
return false;
|
214
|
+
}
|
215
|
+
|
216
|
+
float sinteresct(in vec3 rO, in vec3 rD )
|
217
|
+
{
|
218
|
+
float res = 1.0;
|
219
|
+
float t = 0.0;
|
220
|
+
for( int j=0; j<50; j++ )
|
221
|
+
{
|
222
|
+
//if( t>1000.0 ) break;
|
223
|
+
vec3 p = rO + t*rD;
|
224
|
+
|
225
|
+
float h = map( p );
|
226
|
+
|
227
|
+
if( h<0.1 )
|
228
|
+
{
|
229
|
+
return 0.0;
|
230
|
+
}
|
231
|
+
res = min( res, 16.0*h/t );
|
232
|
+
t += h;
|
233
|
+
|
234
|
+
}
|
235
|
+
|
236
|
+
return clamp( res, 0.0, 1.0 );
|
237
|
+
}
|
238
|
+
|
239
|
+
vec3 calcNormal( in vec3 pos, float t )
|
240
|
+
{
|
241
|
+
float e = 0.001;
|
242
|
+
e = 0.001*t;
|
243
|
+
vec3 eps = vec3(e,0.0,0.0);
|
244
|
+
vec3 nor;
|
245
|
+
nor.x = map2(pos+eps.xyy) - map2(pos-eps.xyy);
|
246
|
+
nor.y = map2(pos+eps.yxy) - map2(pos-eps.yxy);
|
247
|
+
nor.z = map2(pos+eps.yyx) - map2(pos-eps.yyx);
|
248
|
+
return normalize(nor);
|
249
|
+
}
|
250
|
+
|
251
|
+
vec3 camPath( float time )
|
252
|
+
{
|
253
|
+
vec2 p = 600.0*vec2( cos(1.4+0.37*time),
|
254
|
+
cos(3.2+0.31*time) );
|
255
|
+
|
256
|
+
return vec3( p.x, 0.0, p.y );
|
257
|
+
}
|
258
|
+
|
259
|
+
void main(void)
|
260
|
+
{
|
261
|
+
vec2 xy = -1.0 + 2.0*gl_FragCoord.xy / iResolution.xy;
|
262
|
+
|
263
|
+
vec2 s = xy*vec2(1.75,1.0);
|
264
|
+
|
265
|
+
#ifdef STEREO
|
266
|
+
float isCyan = mod(gl_FragCoord.x + mod(gl_FragCoord.y,2.0),2.0);
|
267
|
+
#endif
|
268
|
+
|
269
|
+
float time = iGlobalTime*.15;
|
270
|
+
|
271
|
+
vec3 light1 = normalize( vec3( 0.4, 0.22, 0.6 ) );
|
272
|
+
vec3 light2 = vec3( -0.707, 0.000, -0.707 );
|
273
|
+
|
274
|
+
|
275
|
+
vec3 campos = camPath( time );
|
276
|
+
vec3 camtar = camPath( time + 3.0 );
|
277
|
+
campos.y = terrain( campos.xz ) + 15.0;
|
278
|
+
camtar.y = campos.y*0.5;
|
279
|
+
|
280
|
+
float roll = 0.1*cos(0.1*time);
|
281
|
+
vec3 cw = normalize(camtar-campos);
|
282
|
+
vec3 cp = vec3(sin(roll), cos(roll),0.0);
|
283
|
+
vec3 cu = normalize(cross(cw,cp));
|
284
|
+
vec3 cv = normalize(cross(cu,cw));
|
285
|
+
vec3 rd = normalize( s.x*cu + s.y*cv + 1.6*cw );
|
286
|
+
|
287
|
+
#ifdef STEREO
|
288
|
+
campos += 2.0*cu*isCyan; // move camera to the right - the rd vector is still good
|
289
|
+
#endif
|
290
|
+
|
291
|
+
float sundot = clamp(dot(rd,light1),0.0,1.0);
|
292
|
+
vec3 col;
|
293
|
+
float t;
|
294
|
+
if( !jinteresct(campos,rd,t) )
|
295
|
+
{
|
296
|
+
col = 0.9*vec3(0.97,.99,1.0)*(1.0-0.3*rd.y);
|
297
|
+
col += 0.2*vec3(0.8,0.7,0.5)*pow( sundot, 4.0 );
|
298
|
+
}
|
299
|
+
else
|
300
|
+
{
|
301
|
+
vec3 pos = campos + t*rd;
|
302
|
+
|
303
|
+
vec3 nor = calcNormal( pos, t );
|
304
|
+
|
305
|
+
float dif1 = clamp( dot( light1, nor ), 0.0, 1.0 );
|
306
|
+
float dif2 = clamp( 0.2 + 0.8*dot( light2, nor ), 0.0, 1.0 );
|
307
|
+
float sh = 1.0;
|
308
|
+
if( dif1>0.001 )
|
309
|
+
sh = sinteresct(pos+light1*20.0,light1);
|
310
|
+
|
311
|
+
vec3 dif1v = vec3(dif1);
|
312
|
+
dif1v *= vec3( sh, sh*sh*0.5+0.5*sh, sh*sh );
|
313
|
+
|
314
|
+
float r = noise( 7.0*pos.xz );
|
315
|
+
|
316
|
+
col = (r*0.25+0.75)*0.9*mix( vec3(0.10,0.05,0.03), vec3(0.13,0.10,0.08), clamp(terrain2( vec2(pos.x,pos.y*48.0))/200.0,0.0,1.0) );
|
317
|
+
col = mix( col, 0.17*vec3(0.5,.23,0.04)*(0.50+0.50*r),smoothstep(0.70,0.9,nor.y) );
|
318
|
+
col = mix( col, 0.10*vec3(0.2,.30,0.00)*(0.25+0.75*r),smoothstep(0.95,1.0,nor.y) );
|
319
|
+
col *= 0.75;
|
320
|
+
// snow
|
321
|
+
#if 1
|
322
|
+
float h = smoothstep(55.0,80.0,pos.y + 25.0*fbm(0.01*pos.xz) );
|
323
|
+
float e = smoothstep(1.0-0.5*h,1.0-0.1*h,nor.y);
|
324
|
+
float o = 0.3 + 0.7*smoothstep(0.0,0.1,nor.x+h*h);
|
325
|
+
float s = h*e*o;
|
326
|
+
s = smoothstep( 0.1, 0.9, s );
|
327
|
+
col = mix( col, 0.4*vec3(0.6,0.65,0.7), s );
|
328
|
+
#endif
|
329
|
+
|
330
|
+
|
331
|
+
vec3 brdf = 2.0*vec3(0.17,0.19,0.20)*clamp(nor.y,0.0,1.0);
|
332
|
+
brdf += 6.0*vec3(1.00,0.95,0.80)*dif1v;
|
333
|
+
brdf += 2.0*vec3(0.20,0.20,0.20)*dif2;
|
334
|
+
|
335
|
+
col *= brdf;
|
336
|
+
|
337
|
+
float fo = 1.0-exp(-pow(0.0015*t,1.5));
|
338
|
+
vec3 fco = vec3(0.7) + 0.6*vec3(0.8,0.7,0.5)*pow( sundot, 4.0 );
|
339
|
+
col = mix( col, fco, fo );
|
340
|
+
}
|
341
|
+
|
342
|
+
col = sqrt(col);
|
343
|
+
|
344
|
+
vec2 uv = xy*0.5+0.5;
|
345
|
+
col *= 0.7 + 0.3*pow(16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y),0.1);
|
346
|
+
|
347
|
+
#ifdef STEREO
|
348
|
+
col *= vec3( isCyan, 1.0-isCyan, 1.0-isCyan );
|
349
|
+
#endif
|
350
|
+
|
351
|
+
gl_FragColor=vec4(col,1.0);
|
352
|
+
}
|