!!ARBfp1.0
OPTION ARB_precision_hint_fastest;

#/*ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ*\
#	File:			Program for XREngine histogram
#					
#	Author:			Magnus Högdahl
#					
#	Copyright:		Starbreeze AB 2004
#					
#	History:
#
#\*____________________________________________________________________________________________*/


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

ATTRIB tc0 = fragment.texcoord[0];

PARAM Range = program.env[0];	# { min, range_rcp, 0, 0 }

PARAM Const1 = { 2.7182818284590, 1, 0, 0 };
PARAM ColorWeight = { 0.3086, 0.6094, 0.0820, 0 };

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

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

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

DP3 r0, t0, ColorWeight;
SUB r0, r0, Range.x;
MUL_SAT r0, r0, Range.y;
MOV r0.b, Const1.y;
MOV oCol, r0;

END

