jfontan/glsl-sandbox — pull request #7 by emackey (2012-03-05 03:13:11+00:00)
Title: Slidable surface, and jsdiff with parent

This pull request contains two large features:

1) There's a new "diff" button for effects that have parent effects. It runs @cemerick's awesome jsdifflib and shows the changes between parent and child (or between any two effects if you hand-edit the URL).

2) This pull request also includes my "slidable surface" that allows users to explore things like fractals, by clicking 'hide code' and then using the mouse to drag (left) and zoom (right) the effect. I wrote this a while ago and I've done a lot of testing on different systems with different types of gfx cards, so I'm confident in it now. This new feature doesn't affect any of the current gallery of effects, you have to add a new line of code ("varying vec2 surfacePosition;") to a new effect to get new behavior. Adding that line to any existing effect, and swapping in the surfacePosition in place of the typical "vec2 position" that gets defined in main() is fairly straightforward, and will allow effects authors to turn on the mouse controls easily.

Let me know what you think! Thanks.