[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] WebGLSL Media Type Proposal
On Sun, May 20, 2012 at 5:36 PM, Benoit Jacob <email@example.com> wrote:
I think the <script> approach has a few problems right now:
Only the handling trough JS of these strings gives them meaning and function.
Exactly like you describe above, with <script> with these pseudo MIME types.
- you can't src those scripts, forcing you to write all your shaders into your html, that's unmaintainable
- Even if you had src, you'd have to #1 add the scripttag via JS (because you wouldn't want to holdup the entire app for shaders that aren't used) #2 wait for the loaded event #3 obtain the scripttag from the DOM #4 extract the innerText #5 pass the innerText to the WebGL api.
- The process above is 1:1 identical to XHRs fetching text, except with an entirely different protocol.
promoting scripptags to load shaders makes as much sense as <script type="text/plain" src="" so why exactly didn't we do that?