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

Re: [Public WebGL] WebGLSL Media Type Proposal

I don't think anyone has the authority to dicate how you structure your
code. People have opinions. Some like 1 class per file. Some like
related classes in the same file. Some like one giant file. Some like
hanging braces, some like braces on a separate line. Some like
CamelCase, some_like_underscores. Some like one var statement per
function. Some like 1 per variable. Some like them declared at the top
of the function. Some like them declared near first use.

Similarly, some like using the script tag to store GLSL, some like to
XHR them as individual text files, some like to XHR them as JSON.

Do whatever you like. Personally I'll keep using <script> tags for most
smaller projects. That's my personal preference.

I went ahead and checked the actual HTML5 standard for the SCRIPT tag:

"When used to include data blocks (as opposed to scripts), the data must be embedded inline, the format of the data must be given using the type attribute, the src attribute must not be specified, and the contents of the script element must conform to the requirements defined for the format used."

Source: http://www.w3.org/TR/html5/the-script-element.html#script

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.

Since this is allowed, the entire tag discussion becomes moot.

Adding IANA media types? With this information in mind, requesting them seems like a good idea.

This leaves us with the narrower problem of sourcing shaders locally, since XMLHttpRequest's behavior for file: is basically undefined. Maybe same-origin policy issues are better brought up on another mailing list.


You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl