this could be your problem:
dp4 r0,v0,c6 // distance to camera position

you dont have c6 defined it seems.. try defining c6 as vecViewPos


Sphere Engine--the premier A6 graphics plugin.