!!ARBfp1.0

#/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ*\
#	File:			Program for CXR_Util::RenderSurface vertex lighting with
#				per-pixel projection mapping.
#					
#	Author:			Magnus Högdahl
#					
#	Copyright:		Starbreeze AB 2005
#
#	History:
#
#\*____________________________________________________________________________________________*/


#-----------------------------------------
# Texture0 = Diffuse texture

#-----------------------------------------
# TexCoord0 = Mapping tex coord

#-----------------------------------------

OUTPUT oCol = result.color;
ATTRIB vCol = fragment.color;

ATTRIB TexCoordMapping0 = fragment.texcoord[0];
ATTRIB TexCoordMapping1 = fragment.texcoord[1];
ATTRIB TexCoordProjMap0 = fragment.texcoord[2];
ATTRIB Light0 = fragment.texcoord[5];
ATTRIB Light1 = fragment.texcoord[6];
ATTRIB Light2 = fragment.texcoord[7];

PARAM const_val = { 0.5, 1.0, 2.0, 4.0 };

TEMP DiffTexel;
TEMP ProjMap0;
TEMP ProjMap1;
TEMP LightResult;

#-----------------------------------------
TEX DiffTexel, TexCoordMapping0, texture[0], 2D;
MUL DiffTexel, DiffTexel, vCol;
TEX ProjMap0, TexCoordProjMap0, texture[2], CUBE;
MUL LightResult.rgb, ProjMap0, Light0;
ADD LightResult.rgb, Light1, LightResult;
ADD LightResult.rgb, Light2, LightResult;
MOV LightResult.a, const_val.y;

MUL_SAT oCol, LightResult, DiffTexel;

END
