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

Re: [Public WebGL] Re: WebGLSL Media Type Proposal



On Mon, May 21, 2012 at 9:13 PM, David Sheets <kosmo.zb@gmail.com> wrote:
When using HTTP content negotiation to serve different aspects of the
same resource. For instance, a WebGLSL resource could be either an
HTML page describing the shader, an FX file containing the shader, the
raw shader source text, a JSON encapsulation of the shader, or a LaTeX
document typesetting the mathematics embodied in the shader.

You're misunderstanding what HTTP content negotiation is for.  It's used--when it's used at all, which is rarely--to choose between functionally equivalent representations of the same resource, such as a JPEG and a GIF of the same picture.  It's not used to choose between completely different resources that are about the same topic; for that you use different URLs.

When writing a program to extract WebGLSL shaders from pages that
embed them in semantic <script> tags, the type of the enclosed source
is a key piece of metadata.

This can be done without the beaurocracy of officially registering a type; all we have to do is agree what to use (eg. text/x-glsl or text/x-glsl-vertex).  Officially registering a type is just a "might be nice"; not a big deal if it's simple, but not worth jumping hoops for.

More generally, when transporting or serializing different
representations of same mathematics embodied in a shader, the media
type is an extremely helpful field to distinguish different
representations.

If you have different implementatiosn of shaders with the same functionality (eg. GLSL and Direct3D shaders--as unlikely as that is in this context, or even in theory), they should have different URLs.  That's what URLs are for.

--
Glenn Maynard