Code Monkey home page Code Monkey logo

patches's Introduction

Patches

====

Patches is a visual programming environment for WebGL, WebVR and other HTML5 APIs. It features live preview, data flow visualization, network communication, publishing, unlimited undo, and a catalog of ready-made patches that can be used as modular building blocks. Complex logic can be nested in subgraphs and they can be rendered directly to a specific render target, or simply used as a texture. Loops are modeled as nested graphs that are evaluated once per loop iteration.

Try the cloud version of Patches now at patches.vizor.io.

Be sure to watch the tutorials, read the documentation and read tutorials on Patches. Plugin API documentation is available, but unstable.

Installing on macOS/OSX

Installing a local instance of Patches requires MongoDB (MongoDB Server should be 3.2.12), Redis, node.js (Get v6.11) and graphicsmagick. To install the required packages, issue the following commands (on Mac using Homebrew):

    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    $ brew install graphicsmagick
    $ brew install mongodb 
    $ brew install redis
    $ brew services start mongodb
    $ brew services start redis
    $ npm install && npm install -g gulp
    $ gulp

NOTE: Currently using Web Sockets or OSC requires running Patches locally.

Building

To build the LESS, plugins, etc [continuously]:

    $ gulp [watch]

Running the tests:

    $ npm install -g mocha
    $ npm test

Quick list of versions for running with Ubuntu Linux

OS: Ubuntu 16.04.2 MongoDB shell version: 3.2.18 Redis server v=3.0.6 Node v6.11.5 NPM 5.5.1

Also, if you do not want to downgrade your node version then upgrade the mongodb package to 2.2.24 and the gridfs-stream package to the latest version.

One more detail, the exiftool can be installed like this sudo apt-get install libimage-exiftool-perl

How to run Patches locally using Windows

Please consult WindowsInstallationReadme.md

Running Patches

  1. Make sure you have the right export for ENGI_BIND_IP configured in your .bash_profile
    export ENGI_BIND_IP=0.0.0.0
  1. Make sure MongoDB and Redis are running.
    $ brew services start mongodb
    $ brew services start redis
  1. Gulp one more time, then run the server:
    $ gulp
    $ npm start
  1. Open in the browser: http://localhost:8000/edit

If you have access to an Oculus Rift DK1 or DK2 and want to play with the VR features, you currently need one of Toji's special Chromium builds. You can find them here: http://blog.tojicode.com/2014/07/bringing-vr-to-chrome.html

Contributing

We welcome your contributions! Please create and work in a fork, submitting a pull request when (and if) you're ready for a review. Contributors may note some inconsistencies in style. We're in the process of migrating; new work should be done in JavaScript ES5 using Airbnb code style (exception: tabs instead of spaces).

A note on plugins

Patches features hundreds of plugins, including ways to obtain or create data:

  • Cameras: Perspective, orthographic and screen space. Obtain aspect radio and viewport size.
  • Input: Gamepad, VR headset, keyboard, mouse position, button state and scroll wheel.
  • Loading assets: HTML5 audio, images, JSON, 3d scenes and HTML5 video. Select files directly from UI or provide URLs to load as strings from the graph.
  • Matrices: Translation, rotation, scale and planar projection.
  • Meshes: Cube, grid, null (transform visualization), plane, quad, sphere and user defined (Blender exporter is included).
  • Open Sound Control: Receive float / xy float.
  • Shaders: Diffuse only, automatically generated from mesh and material, user defined, normal as color and texture with UV-transforms.
  • System state: Initialized, assets started, failed, and successfully loaded. Graphs can emit these signals via plugins to integrate with the global asset load logic when procedurally generating data.
  • Text rendering.
  • Time: Absolute, frame delta.
  • Typed array generation.
  • Web Sockets.
  • Crypto: Check the current balances of a named CounterWallet.
  • Virtual Reality: Camera / MHD / Sensor info. Sensor velocity / acceleration. Full Oculus Rift support.
  • Various plugins to provide UI for direct manipulation or input of values: Knobs, sliders, input fields for labels and constant values, toggle and action buttons, color pickers, text editors, PRNGs and many other similar plugins for providing data directly from the graph view.

...Ways to modify data:

  • Audio: Get duration and current playback position. Analysis (FFT), gain, buffer source.
  • Color: Add, mix, multiply and set alpha.
  • Data type conversions. Format or parse strings, compose complex types from primitives, convert between primitive types and split / merge cameras to / from constituent matrices.
  • Curves: Looping cubic interpolation of keypoints.
  • Filters: First order low pass, sample and hold, toggle.
  • Instanced meshes: Clear transforms, rotate, scale, translate.
  • Light sources (point, directional): Diffuse color, direction, intensity, position, specular color and type.
  • Logic: And, equals, if, if...else, less than, more than, nand, not, or, switch and xor.
  • Materials: Alpha clip, ambient color, blend mode (none, add, sub, mul, normal), diffuse color, double sided, attach lights, shininess, textures (diffuse, emission, specular and normal maps), z-buffer (use / write).
  • Math: Add, clamp, divide, module, multiply, negate, subtract, delta, abs, cos, exp, log, max, min, sin, sqrt, tan, ceil, floor and round.
  • Matrix: Concatenate, get component, invert, set component and transpose.
  • Mesh: Primitive type (points, lines, line strip, line loop, triangles, tristrip, trifan). Obtain or set the maximum primitive count to render.
  • Object: Convert named member to float, bool, string, object or typed array. Access any array item of the those same types by index and object member name.
  • Oscillators: Cosine, sawtooth, sine, square, triangle.
  • Scene: Get bounding box, get mesh, get mesh count.
  • String: Concatenate, parse JSON.
  • Tweens: In / out (circular, cubic, exponential, quadratic, quartic, quintic and sinusoidal).
  • Typed arrays: Array to mesh, array to texture, get element, get element as type, length, set element, set element as type.
  • Virtual Reality: Create Oculus Rift compatible left / right camera from an input camera.
  • Vector: Add, cross, dot product, magnitude, multiply, normalize, scale and transform.
  • Video: Current time and duration.

...Ways to utilize data:

  • 3D: Render scene, render mesh, create instanced meshes (arrays, cubic volumes, using iterated function systems or distribution textures) and record the current framebuffer.
  • Audio: Player / Source player.
  • Debug visualization: On-canvas visualization of booleans, colors, arbitrary data, floats, matrices, objects, function plots, text and vectors.
  • Sequencing: Stop playback.
  • Video: Player.

...And ways to structure logic or store state:

  • Create infinitely nested sub-graphs or loops.
  • Create named in- and output proxies in a graph to have them automatically reflected as a slot on the parent node of the graph the proxy is in.
  • Create named registers to store values of any supported data type between graph updates as state storage or feedback loops.

Created sequences can be imported and exported as JSON, embeddable into any context with the included standalone player, or simulated in a bare core instance. The latter permits sequences to be leveraged in other JavaScript projects as a domain-specific visual scripting language by providing the embedded graph with appropriate values from its host, updating the graph and acting on the emitted output values. Created sequences can be automatically exported to an optimized file set, ready to deploy to any Web server.

License

Patches is released under the MIT License

Contact Us

@vizor_vr on Twitter @VizorPatches on Twitter

E-Mail

patches's People

Contributors

eric-schleicher avatar ericelliott avatar esaruoho avatar fthr avatar gmarinov avatar imgrby avatar joukosaastamoinen avatar juho avatar kkananen avatar kschzt avatar ksurdacki avatar larskluge avatar lpn avatar mattatgit avatar mayalekova avatar sakari369 avatar tocacar avatar yolque avatar zlatanvasovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

patches's Issues

Array plugin

Make an Array plugin with dynamic number of ANY datatype inputs, and an index input that changes the current output value of the plugin.

inputs: index, 0, 1, 2, 3, ... 
outputs: output

Eg. feed in 8 images, and alternate between the images with index

dependency graph re-evaluation issue

see example:
http://create.vizor.io/uucidl/draw_scaled_image/edit

In this sketch I have a texture fed into a graph that will render it to the framebuffer

After you load the sketch for the first time in your browser, and you press play, nothing is shown.
Press edit into the draw_image subgraph. You will see the texture resolution is read as 0x0
Now press stop and play again, the texture resolution is now 512x512 and the picture shows.

Undo

  • add way of addressing any node by path
  • a way for Plugin's UI to report and react to changes in state/model
  • a way for Graph and NodeUI to report changes in graph shape
  • record changes into stack
  • rollback changes from stack -> change graph structure, state by address, and notify UI

Window resizing problem

window-resizing-problem

After some mysterious combination on web browser window resizing create.vizor.io renders wider than web browser window causing horizontal scroll bar to be displayed.

Google Chrome version 39.0.2171.95 m

Get rid of synchronous XHR calls

Most calls to XHR assume synchronous XHR is available, which causes load-time/initialization issues when it is not. Get rid of the ancient synchronous XHR calls.

TODO annotations

When working on some graphs or tools for a certain amount of time, it is useful to keep track of assumptions and missing features. One way to do that already is to simply create annotations.
Vizor could help us out further by harvesting these special TODO annotations so they are listed in a project management box.
A format I have seen used is the following:

TODO(<name of collaborator>) we don't do this necessary feature for now because <this / that but> let's not forget about it when <something> happen

Having the name of the person tagged in this way allows to group these TODOs according to their owner.
It's easy to extend this system to other kind of tags like NOTEs with another prefix.
It would also be quite useful for these to be harvested from shader code as well, so as not to treat them like second class citizen.
With this feature, vizor would immediately gain a small yet pragmatic way of dealing with project management.

Marquee selection freezes on screen in a certain mesh preset subgrapoh

To reproduce:

  1. new graph, press play
  2. load the preset: mesh with camera material and light and transforms
  3. go inside the mesh subgraph
  4. load a plugin using the search box: mesh/null
  5. disconnect the existing "cube" mesh from the mesh slot in "mesh" subgraph
  6. connect the "null" plugin to that mesh slot
  7. use a marquee to select the 3 orbit camera sliders
  8. blue marquee square should now freeze on the edit canvas

Screenshots attached.

marquee-freeze-bug-2
marquee-freeze-bug-1

Headless integration testing

Build a number of test cases that can be executed quickly, as an intermediate step between unit tests and full-fledged browser integration tests.

  • method of executing graphs headlessly (mock gl?)
  • method of testing graph outputs (via parameterListeners?)
  • implement test case graphs and expect results (a few fundamental system assertions)
  • add as part of npm test

No less than or equal to plugin and alike

It obviously can be done by "or", "equal" and "less than" plugins but than, why there are "and", "or" and "not" plugins while they can be assembled from "nand"s ?

Missing logic plugins:

  • less than or equal
  • more than or equal
  • unequal
  • almost equal/unequal with definable proximity

Menubar refactor

Refactor the structure and style for the menu bar (logo, file, play, user, and help buttons).

  • Fix button heights
  • Remove forced navbar and user-pulldown styling
    and fix Login and Signup button heights.

Logging system improvements

  • replace msg() with a proper logging system (Tattletale.js?)
  • report error stack traces somewhere (Papertrail?)
  • send server logs too (winston + Papertrail?)

Hotkeys for input proxy/output proxy/subgraph

These are the three most common plugins that are inserted into graphs, so they should have hotkeys for faster workflows.

Suggestions:
I for input proxy
O for output proxy
G for subgraph

Use case:
Hit G and the "Name new graph" dialog is opened. User puts in a name and the subgraph is created.
Hit I and a new input proxy with the default name (input-n) is created in the graph.
Hit O and a new output proxy with the default name is created in the graph.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.