!!ARBvp1.0
PARAM mvp[4]		= {state.matrix.mvp};
PARAM mvinv[4]		= {state.matrix.modelview.invtrans};
PARAM mv[4]			= {state.matrix.modelview};
PARAM offset		= program.local[0];
ATTRIB posi			= vertex.position ;
ATTRIB positrans	= vertex.attrib[13] ;
ATTRIB norm			= vertex.normal ;  
ATTRIB normtrans	= vertex.attrib[14] ;  
PARAM lightamb0     = state.lightprod[0].ambient ;
PARAM sceneambient  = state.lightmodel.ambient ;
PARAM matambient    = state.material.ambient ;
PARAM lightaten0	= state.light[0].attenuation ;
PARAM lightpos0     = state.light[0].position;  
OUTPUT pos			= result.position ;
OUTPUT texture0		= result.texcoord[0] ;
OUTPUT texture1		= result.texcoord[1] ;
OUTPUT texture2		= result.texcoord[2] ;
OUTPUT texture3		= result.texcoord[3] ;
OUTPUT posview      = result.texcoord[4] ;
OUTPUT normal       = result.texcoord[5] ;
OUTPUT lightglobal  = result.texcoord[6] ;
TEMP   temp,temp1;
#Calculate point coords in modelview space
MAD		temp.x,offset.x,positrans.x,posi.x ;
MAD		temp.y,offset.x,positrans.y,posi.y ;
MAD		temp.z,offset.x,positrans.z,posi.z ;
MOV		temp.w,1;
DP4		temp1.x, mvp[0], temp;
DP4		temp1.y, mvp[1], temp;
DP4		temp1.z, mvp[2], temp;
DP4		temp1.w, mvp[3], temp;
MOV		pos,temp1;
DP4		posview.x, mv[0], temp;
DP4		posview.y, mv[1], temp;
DP4		posview.z, mv[2], temp;
#Calculate normal in eye space
MAD		temp.x,offset.x,normtrans.x,norm.x ;
MAD		temp.y,offset.x,normtrans.y,norm.y ;
MAD		temp.z,offset.x,normtrans.z,norm.z ;
DP4		normal.x, mvinv[0], temp;
DP4		normal.y, mvinv[1], temp;
DP4		normal.z, mvinv[2], temp;
MAD		lightglobal,sceneambient,lightamb0,matambient ;
#Attenuation
MOV		temp.xyz, lightpos0;
ADD		temp.xyz, -temp1, temp;
DP3		temp.x, temp, temp;
RSQ		temp.x, temp.x;
RCP		temp.x, temp.x;
MUL		temp.y, temp.x, lightaten0.z;
MUL		temp.z, temp.x, lightaten0.y;
ADD		temp.z, temp, lightaten0.x ;
MAD		temp.x, temp.y, temp, temp.z;
RCP		lightglobal.w, temp.x;
#Texture coords
MOV		texture0,vertex.texcoord[0] ;
MOV		texture1,vertex.texcoord[1] ;
MOV		texture2,vertex.texcoord[2] ;
MOV		texture3,vertex.texcoord[3] ;
MOV		result.color,vertex.color;
END