Is this doable? Say I wanted to call a vertex shader over and over using UsePass and just change a value based on the pass number. (Yeah for a basic fur shader)
Or would I need to have duplicate the vertex shader a bunch of times and change one number?
Directly - not really. What you can do is define the vertex shader code in separate .cginc file and include that (take a look at grass shaders for example). Or there is an almost-hidden feature with using Cg between CGINCLUDE/ENDCG blocks (not CGPROGRAM/ENDCG); the contents will be “pasted” into any further CGPROGRAM blocks (Reflective water shader uses that).
I’ll do something like that. I’m kind of curious as to how the fur shader code shaunis pasted uses PASSCOUNT and PASSINDEX. It looked like Cg from here.
It does look like an .fx file; however there’s no automated way to use pass count/index in .fx files either. Of course, if that shader is from some tech demo, then the tech demo can just set passcount/passindex properties before drawing each pass.