[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] WebGLSL Media Type Proposal



RE this entire thread:

if you ship a real app you will for sure not be embedding GLSL in the HTML with <script> nor will you be requesting scripts individually with XHR - you will be generating code to pack in via your js minifier/compiler or building libraries of shaders in a custom, domain-specific format.

From my experience, doing 'python -m SimpleHTTPServer' to get around file:// access when experimenting is so easy that there's no excuse to not do it and put an end to worrying about file/same-origin/etc. If you're building an offline-only embedded webkit app (or something crazy like that), see the first point.

The only case where any of the script stuff makes sense is one-off hello-world scale experiments and demos and in that case you've got a bunch of boilerplate copied in anyway - adding one line more to pull innerText out of a <script> is no biggie.

The only benefit I see of an IANA registration is that maybe then some syntax highlighters in IDEs (or browser inspectors) will become GLSL aware. It should *never* be used as an interchange format: GLSL is not a container format, cannot stand alone, and needs some kind of wrapper to be useful. I'd be much more interested if someone put an effort behind something similar to MSFT's FX files -- that's something that would deserve a registration and the artifacts of which could be useful across applications/providers.

On Mon, May 21, 2012 at 1:55 PM, Florian Bösch <pyalot@gmail.com> wrote:
On Mon, May 21, 2012 at 9:13 PM, Thor Harald Johansen <thj@thj.no> wrote:
So, HTML5 basically approves of using SCRIPT tags for including data blocks. If anybody ever discourages this usage from now on, I'll just refer them to that paragraph.
Of course you can write anything into scripttags. That doesn't mean it's a bright Idea. The issues isn't that it wouldn't be allowed. The issues is that beginners see examples like that, and then start writing bigger apps, and suddenly they notice "heck, this is fucking unmaintainable" and then they have no clue how to do things, or that there would be an XHR that they can use, because going from <script>inline</script> to XHR is entirely non-obvious.