pouët.net

GLSL Sandbox

category: code [glöplog]
Mr.doob: Your latest version fails to run locally here, but it runs if I install it on a webserver... I get "Uncaught Error: SECURITY_ERR: DOM Exception 18" at lzma.js:73... Any clue as to what's wrong?
added on the 2011-11-11 09:55:37 by kusma kusma
Kusma: Something to do with loading a WebWorker scipt locally. For some strange reason, your browser deems it unsafe to load a local worker script for a local page.
added on the 2011-11-11 10:13:01 by p01 p01
p01: How do I make it go away?
added on the 2011-11-11 10:24:25 by kusma kusma
I sense a "Lights" remake competition coming up ;)
added on the 2011-11-11 10:24:28 by raer raer
raer: Not really, but I have set some stuff in motion that I hope will pan out. The future will tell :)
added on the 2011-11-11 11:06:49 by gloom gloom
I really love the GLSL Sandbox idea of putting the shader in the URL with a URL shortening service.
Its a great way of distribuiting simple shader experiments!
Nice job Mr.doob :)
kusma: I assume you're using Chrome? Try launching it with this flag "--allow-file-access-from-files".

PauloFalcao: \:D/
added on the 2011-11-11 14:26:02 by mrdoob mrdoob
I've been playing with the GLSL Sandbox and added a database to store the code. You can check the live page at http://glsl.heroku.com/.

The code can be downloaded at https://github.com/jfontan/glsl-sandbox.

The page is hosted in heroku and is free for these small apps. I can change the name of the subdomain if some of you want to take it over.
added on the 2011-11-11 15:02:37 by the vaw the vaw
Uhm, feature wise the only improvement is shorter URLs. What about adding a page listing of all the programs on the database with a snapshot? Like this:

http://glsl.heroku.com/ - list of all the programs
http://glsl.heroku.com/program/ID - program

Maybe something like http://www.ro.me/gallery/ (without the title/voting stuff).
added on the 2011-11-11 15:11:00 by mrdoob mrdoob
My initial idea was similar to what you propose but adding also versions, so next saves are stored separately and you can follow the process to create the shader. Some time after fighting with the code I deemed it too much for a two hours hack (first time js, mongo, heroku and so little web app experience).

http://glsl.heroku.com/8874/5 - version 5 of 8854
http://glsl.heroku.com/8874 - last version of 8854

I'll try to get some time this weekend to add the index and maybe change the hashes and use numbers instead. Versioning is just wishful thinking.
added on the 2011-11-11 15:23:22 by the vaw the vaw
mmmh, don't pasteBin or similar have an API that could be used to store the code of the shader and even do some sort of versionning ? Then you can use the same HASH as the corresponding pasteBin entry
added on the 2011-11-11 15:29:36 by p01 p01
It does but not JSONP so I think I cannot store or get the code using javascript. If the code could be stored in pastebin I would get rid of the server altogether, but that wont let us have some kind of gallery.
added on the 2011-11-11 15:34:23 by the vaw the vaw
Wow that last one example is great :D

Mr. doob: thank a lot for adding the 1*1/2*2/4*4 option \o/
added on the 2011-11-11 16:08:28 by rez rez
I'll go ahead and presume my config is the problem here, but since this morning all of the sandbox examples are upside down on my hackintosh :)
added on the 2011-11-11 18:54:53 by Shifter Shifter
That's weird... I've tried on my osx and doesn't do that...
added on the 2011-11-11 19:33:20 by mrdoob mrdoob
*on osx
added on the 2011-11-11 19:36:03 by mrdoob mrdoob
Ran like a slideshow on the legit Mac Mini, but you have to admit this looks novel:

BB Image

Again, it's probably the hackintosh being weird for the sake of it.
added on the 2011-11-11 19:48:15 by Shifter Shifter
I really want to understand why this happens. I've seen people having issues with three.js particles sometimes rendering upside down. Anyone has any pointer?

Btw, use the 1x1 selector to make it less slideshow-ish.
added on the 2011-11-11 20:14:26 by mrdoob mrdoob
Try using the 4x4 selector, not the 1x1, Mr.doob mistyped that.

And try changing:
for(int i=0;i<256;i++){
to
for(int i=0;i<32;i++){

Some GLSL compilers/drivers can't optimize the exit from the loop on break and always run all iterations.
It's true! This happens to my old laptop with an Intel card LOL

Also resizing the browser to a smaller window is always an option ;)
I also had the upside down problem on some old browser versions.
A quick fix was to to change
vec3 vuv=vec3(0,1,0);
to
vec3 vuv=vec3(0,-1,0);

Or
vec2 vPos=-1.0+2.0*gl_FragCoord.xy/resolution.xy;
to
vec2 vPos=1.0-2.0*gl_FragCoord.xy/resolution.xy;
Quote:
Btw, use the 1x1 selector to make it less slideshow-ish.

No worries, teletext mode runs slightly better (but still slow) on a 9400M mini.

I can't recall updating anything potentially destructive since yesterday and I'm mildly insane about browser versions. Hackintosh involved runs 10.7.2 with a Radeon 5770 and only does this upside-down thing with the GLSL sandbox.
added on the 2011-11-12 00:10:29 by Shifter Shifter
I'm working on a MacMini with a geforce 9400M too (albeit running linux instead). 1x1 is a bit jumpy, but 2x2 is pretty smooth already.
added on the 2011-11-12 00:31:00 by mrdoob mrdoob
Yet another noiseball. http://tinyurl.com/bq6rshd
A twist on noiseball. http://tinyurl.com/c8pkyhd
Yet another twist. http://tinyurl.com/cmmtyrf
added on the 2011-11-13 11:46:13 by mrdoob mrdoob

login