Custom Shaders Within JavaScript

Hello,

I’m trying to make my own custom shader within my JavaScript code. The problem I’m facing is that I can’t seem to get more than one property within the shader. It’s todo with my syntax layout - I’ve never worked with custom shaders before:

var shaderText =
        "Shader \"Particles/Additive\" {" +
        "Properties { _TintColor (\"Tint Color\", Colour) =  (1,1,1,0.5) _MainTex (\"Base (RGB)\", 2D) = \"white\" }" +
        "SubShader {" +
        "    Tags { \"Queue\" = \"Transparent\" }" +
        "    Pass {" +
        "        Blend One One ZWrite Off ColorMask RGB" +
        "        Material { Diffuse [_Color] Ambient [_Color] }" +
        "        Lighting On" +
        "        SetTexture [_Dummy] { combine primary double, primary }" +
        "    }" +
        "}" +
        "}";

The problem is right in the ‘Properties’ bit - how do I have more than one?

Thanks

You can’t have multiple “Properties” blocks (and this has nothing to do with JavaScript).

A single Properties block is for multiple properties; in fact you already have two properties in your shader (_TintColor and _MainTex).