<arbvp>
<variablemap variable="light ambient" destination="register 0" />
<variablemap variable="texture scale" destination="register 1" />
<program>
<![CDATA[
!!ARBvp1.0
#---------------------------------------------------
# terrain texture splatting with constant light term
#---------------------------------------------------
# Incoming constants from the program
PARAM mvi[4]	 	= { state.matrix.modelview.inverse };
PARAM mvp[4]		= { state.matrix.mvp };
PARAM lightAmbient  	= program.local[0];
PARAM texscale  	= program.local[1];

# Per-Vertex data used
ATTRIB iPos		= vertex.position;
ATTRIB iTex0		= vertex.texcoord[0];

# Output to FP
# Position in perspective space
OUTPUT oPos		= result.position;
# Light color
OUTPUT oCol0		= result.color;
# Object diffuse texture coord (scaled via material parameter)
OUTPUT oTex 		= result.texcoord[0];
# Object splat alpha map coord (scaled by alpha scale not to tiled)
OUTPUT oSplat		= result.texcoord[1];


# translate in position to perspective space
DP4 oPos.x, mvp[0], iPos;
DP4 oPos.y, mvp[1], iPos;
DP4 oPos.z, mvp[2], iPos;
DP4 oPos.w, mvp[3], iPos;

MUL oTex, texscale, iTex0;

MOV oSplat, iTex0;

# pass through ambient light color
MOV oCol0, lightAmbient;

END
]]>
</program>
</arbvp>
