////////////////////////////////////////////////
//
// miscellaneous edit shaders
//
////////////////////////////////////////////////

shader 0 "blendbrush" [
    attribute vec4 vvertex, vcolor;
    uniform mat4 camprojmatrix;
    uniform vec4 texgenS, texgenT;
    uniform float ldrscale;
    varying vec4 color;
    varying vec2 texcoord0;
    void main(void)
    {
        gl_Position = camprojmatrix * vvertex;
        color = vec4(ldrscale * vcolor.rgb, vcolor.a);
        texcoord0 = vec2(dot(texgenS, vvertex), dot(texgenT, vvertex));
    }
] [
    uniform sampler2D tex0;
    varying vec4 color;
    varying vec2 texcoord0;
    fragdata(0) vec4 fragcolor;
    void main(void)
    {
        fragcolor = texture2D(tex0, texcoord0).r * color;
    }
]

lazyshader 0 "prefab" [
    attribute vec4 vvertex, vcolor;
    attribute vec3 vnormal;
    uniform mat4 prefabmatrix;
    uniform mat3 prefabworld;
    varying vec3 nvec;
    varying vec4 color; 
    @(msaainterpvert)

    void main(void)
    {
        gl_Position = prefabmatrix * vvertex;
        color = vcolor;
        nvec = prefabworld * vnormal;
        @(msaapackvert)
    }
] [
    varying vec3 nvec;
    varying vec4 color; 
    @(msaainterpfrag)

    void main(void)
    {
        gcolor.rgb = color.rgb;
        gcolor.a = 0.0;
        vec3 normal = normalize(nvec);
        @(gnormpackdef normal packnorm)
        @(msaapackfrag)
    }
]

