!!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 xpos			= vertex.attrib[12] ;
ATTRIB ypos			= vertex.attrib[13] ;
ATTRIB zpos			= vertex.attrib[0] ;
ATTRIB xnormal		= vertex.attrib[2] ;  
ATTRIB ynormal		= vertex.attrib[14] ;  
ATTRIB znormal		= vertex.attrib[15] ; 
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
DP4     temp.x,xpos,offset;
DP4     temp.y,ypos,offset;
DP4     temp.z,zpos,offset;
MOV     temp.w,1.0 ;
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
DP4     temp.x,xnormal,offset;
DP4     temp.y,ynormal,offset;
DP4     temp.z,znormal,offset;
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