
struct myVertexOut {
    float4 column0 : COLOR0;  // First Column of matrix.
    float4 column1 : COLOR1;  // Second Column of matrix.
    float4 tex0 : TEXCOORD0;
    float4 column2 : TEXCOORD1;  // Third Column of matrix.
};


float4 main(myVertexOut I,
            uniform sampler2D colorMap) : COLOR
{
    float4 result;
    float4 color = tex2D(colorMap, I.tex0.xy);

    // Column 0 of matrix
    float3 matCol0 = 2 * (I.column0.xyz - .5);

    // Column 1 of matrix
    float3 matCol1 = 2 * (I.column1.xyz - .5);

    // Column 2 of matrix
    float3 matCol2 = 2 * (I.column2.xyz - .5);

    //  Algorithm used:    
    //   color multipled by the 3x3 color matrix = 

    result.x = dot(color.xyz, matCol0);
    result.y = dot(color.xyz, matCol1);
    result.z = dot(color.xyz, matCol2);
    result.w = 1;

    return result;
}

