!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

#/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ*\
#	File:			Program for COR:EFBB post processing effects
#					
#	Author:			Magnus Högdahl
#					
#	Copyright:		Starbreeze AB 2004
#					
#	History:
#
#\*____________________________________________________________________________________________*/

#-----------------------------------
OUTPUT oCol = result.color;

ATTRIB tc0 = fragment.texcoord[0];

PARAM parXSize = program.env[0];
PARAM parYSize = program.env[1];
PARAM parTimer = program.env[2];
PARAM fadeAll  = program.env[3];

TEMP t0;
TEMP r0;
TEMP r1;

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

TEX t0, tc0, texture[0], 2D;

DP3 r0, t0, t0;
MAD r0, r0, t0, t0;
LRP r0, parTimer, r0, t0;

DP3 r0, t0, t0;
SUB r0, 1, r0;
LRP r0, parTimer, r0, t0;

MOV r0, tc0;
ADD r0.x, r0.x, parXSize;
TEX t0, r0, texture[0], 2D;
MOV r1, t0;

MOV r0, tc0;
SUB r0.x, r0.x, parXSize;
TEX t0, r0, texture[0], 2D;
ADD r1, r1, t0;

MOV r0, tc0;
ADD r0.y, r0.y, parYSize;
TEX t0, r0, texture[0], 2D;
ADD r1, r1, t0;

MOV r0, tc0;
SUB r0.y, r0.y, parYSize;
TEX t0, r0, texture[0], 2D;
ADD r1, r1, t0;

MUL r0, parTimer, 4;
MAD r1, r1, r0, t0;

MOV r0, r1;

#LRP r0, parTimer, r0, t0;
LRP r0, fadeAll, 1, r0;

MOV oCol, r0;

END

