6

Is there any kind of established MIME type for OpenGL shader program source code? I know that the official IANA table doesn't seem to mention one such, so it would have to be some experimental (x-…) or some vendor-specific (vnd.…) subtype, probably of the text/… main type. According to What is the correct file extension for GLSL shaders? there doesn't even seem to be an established file name extension for these, but that's a quite separate problem to me.

Background:
I sometimes want to include shader code in a <script> tag for some WebGL application, and I want to write the type= attribute of that tag in a way which is semantically as reasonable as possible, even though at the moment I can't think of any actuall difference such a choice would make (unless I call it text/javascript or something similarly stupid). But nevertheless, it would be nice to be already conforming to any tools which might develop over time, building on currently established standards that I don't know about yet.

Community
  • 1
  • 1
MvG
  • 51,562
  • 13
  • 126
  • 251
  • The spec calls for UTF-8 encoded Unicode, `text/plain` sounds reasonable, might double-check the server is sending `charset=utf-8` in the HTTP headers. – genpfault Mar 09 '15 at 18:46

1 Answers1

8

The draft glTF standard written by Khronos states to use text/plain for GLSL files.

Jephir
  • 1,071
  • 15
  • 15