!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

#/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ*\
#	File:			Program for XREngine final framebuffer paste
#					
#	Author:			Magnus Högdahl
#					
#	Copyright:		Starbreeze AB 2004
#					
#	History:
#
# 		Cycles/64 pixel vector: ALU 16, vertex 0, texture 16, sequencer 12, interpolator 8
# 		3 GPRs, 63 threads, Performance (if enough threads): ~16 cycles per vector
#		577400 ns @ 1280x720
#\*____________________________________________________________________________________________*/


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

ATTRIB tc0 = fragment.texcoord[0];
ATTRIB tc1 = fragment.texcoord[1];

TEMP t0;
TEMP t1;
TEMP r0;
TEMP r1;

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

TEX t0, tc0, texture[0], 2D;
TEX t1, tc1, texture[1], 2D;

#ADD oCol, t0, t1;

#MUL t1,t1,t1;
#MUL t0,t0,t0;

ADD r0, t0, t1;
MUL r1.rgb, t0, t1;
SUB_SAT r0.rgb, r0, r1;
MUL r0.rgb, r0, 1.1;

RSQ r0.x, r0.x;
RSQ r0.y, r0.y;
RSQ r0.z, r0.z;
RCP r0.x, r0.x;
RCP r0.y, r0.y;
RCP r0.z, r0.z;

MOV oCol, r0;

END

