!!ARBvp1.0 OPTION ARB_position_invariant ;

# input:
# 
# texcoord[0] TEX0	texcoords
#
# local[0]	scroll
# local[1]	deform magnitude (1.0 is reasonable, 2.0 is twice as wavy, 0.5 is half as wavy, etc)
#
# output:
# 
# texture 0 is _currentRender
# texture 1 is a normal map that we will use to deform texture 0
#
# texCoord[1] is the model surface texture coords
# texCoord[2] is the copied deform magnitude

TEMP	R0, R1, R2;

# texture 1 takes the texture coordinates and adds a scroll
ADD		result.texcoord[1], vertex.texcoord[0], program.local[0];

END

#======================================================================

!!ARBfp1.0 
OPTION ARB_precision_hint_nicest;

# texture 0 is _currentRender
# texture 1 is a normal map that we will use to deform texture 0
#
# env[0] is the 1.0 to _currentRender conversion
# env[1] is the fragment.position to 0.0 - 1.0 conversion

TEMP	localNormal, R0;

PARAM	subOne = { -1, -1, -1, -1 };
PARAM	scaleTwo = { 2, 2, 2, 2 };

# calculate the screen texcoord in the 0.0 to 1.0 range
MUL		R0, fragment.position, program.env[1];

# scale by the screen non-power-of-two-adjust
MUL		R0, R0, program.env[0];

# load the screen render
TEX		result.color.xyz, R0, texture[0], 2D;
# MOV		result.color.xyz, scaleTwo;

END

