!!ARBfp1.0

###################################################################################
#
# Copyright 2009 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of either or both of the following licenses:
#
# 1) the GNU Lesser General Public License version 3, as published by the
# Free Software Foundation; and/or
# 2) the GNU Lesser General Public License version 2.1, as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
# PURPOSE.  See the applicable version of the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of both the GNU Lesser General Public
# License version 3 and version 2.1 along with this program.  If not, see
# <http://www.gnu.org/licenses/>
#
# Authored by: Mirco Mueller <mirco.mueller@canonical.com>
#            : Jay Taoko <jay.taoko@canonical.com>
#
# Sample the texture 7 times and multiply by the gaussian coeeficient in
# factor1 and factor2
# size: the width or height of the texture
# d = 1/size
# texture = -3*d*tex0 - 2*d*tex1 - 1*d*tex2 + 0*d*tex3 + 1*d*tex4 + 2*d*tex5 + 3*d*tex6
#
###################################################################################

# 
ATTRIB primColor = fragment.color.primary;


PARAM factors1 = program.local[0];
PARAM factors2 = program.local[1];

OUTPUT fragColor = result.color;

TEMP sample;
TEMP sum;

MOV sum.rgba, 0.0;

TEX sample, fragment.texcoord[0], texture[0], 2D;
MAD sum.rgba, sample, factors1.x, sum;

TEX sample, fragment.texcoord[1], texture[0], 2D;
MAD sum.rgba, sample, factors1.y, sum;

TEX sample, fragment.texcoord[2], texture[0], 2D;
MAD sum.rgba, sample, factors1.z, sum;

TEX sample, fragment.texcoord[3], texture[0], 2D;
MAD sum.rgba, sample, factors1.w, sum;

TEX sample, fragment.texcoord[4], texture[0], 2D;
MAD sum.rgba, sample, factors2.x, sum;

TEX sample, fragment.texcoord[5], texture[0], 2D;
MAD sum.rgba, sample, factors2.y, sum;

TEX sample, fragment.texcoord[6], texture[0], 2D;
MAD sum.rgba, sample, factors2.z, sum;

MUL fragColor, sum, primColor;

END

