View Full Version : Reference for script-type: x-shader

11-03-2011, 08:11 AM
I am seraching for a reference or specification for the type of a shader. Many examples, like Learning WebGL (http://learningwebgl.com/) or Mozilla's "Getting started with WebGL" (https://developer.mozilla.org/en/WebGL/Getting_started_with_WebGL) are useing shaders likte this:

<script id="shader-fs" type="x-shader/x-fragment">

But I cant find a declaration of the type-attribute. Don't understand me wrong, I do know the difference between a fragment- and a vertex-shader, but I dont understand why I should define the type in the script-tag. I can not find anything about that in the HTML-Sec nor the WebGL-Spec. Since I am writing my diploma thesis about the topic "WebGL", I have to declare what is going on there.. Can anybody help me?
(excuse my english skills)

11-30-2011, 07:50 AM
It isn't specified anywhere; it's just convention and you can put it your own type.
But I suggest you to load shaders from external files.