Is there a way to reference a custom shader from within the json material format in three.js?
<p>The JSON Object Scene format 4 for Three.js has a specification for materials defined here: <a href="https://github.com/mrdoob/three.js/wiki/JSON-Material-format-4" rel="nofollow noreferrer">JSON Material Format 4</a></p>

<p>But it is not clear, at least not to me, how or weather it is possible to reference a custom shader from there. Any ideas how this can be done?</p>

<p><strong>[UPDATE]</strong></p>

<p>I guess my question was not clear enough what I am talking about is having the JSON loader be able to interpret a material define by a custom shader. This is an excerpt of the JSON Object Scene format 4:</p>

<pre><code>"materials": [
    {
        "uuid": "87D95D6C-6BB4-4B8F-8166-A3A6945BA5E3",
        "type": "MeshPhongMaterial",
        "color": 16777215,
        "ambient": 16777215,
        "emissive": 0,
        "specular": 1118481,
        "shininess": 30,
        "opacity": 1,
        "transparent": false,
        "wireframe": false
    }
],
"object": {
    "uuid": "89529CC6-CBAC-412F-AFD1-FEEAE785BA19",
    "type": "Scene",
    "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
    "children": [
        {
            "uuid": "33FA38D9-0AAC-4657-9BBE-5E5780DDFB2F",
            "name": "Box 1",
            "type": "Mesh",
            "geometry": "C3BF1E70-0BE7-4E6D-B184-C9F1E84A3423",
            "material": "87D95D6C-6BB4-4B8F-8166-A3A6945BA5E3",
            "matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
        },
</code></pre>

<p>As you can see, a mesh can reference a material by its UUID. The JSON loader, when loading this file, will check the type of this material, and based on it, create an instance of that material with the provided parameters. The problem that I have is that the types of materials are predefined inside the WebGLPrograms function and I can't find a clear way to extend this list with a custom shader.</p>