Preamble: This thread feels somewhat off-topic for these message boards, so if you know of a better place to discuss this, then please let me know! I couldn’t find any discussion groups that focus on Cg…
If my vertex shader uses uniforms or samplers I have two choices. I could pass them in as parameters, or use them as globals.
In either case, they will be global in the CgFX file, just in one case I’ll pass in the global explicitly.
Is there any good reason to do this one way or the other? The advantages of passing in as params is that it feels a bit cleaner, and would let me pass in different parameters for different passes. But are there any disadvantages that I miss?
Also, if I use globals only, is the compiler smart enough, to bind in only the uniforms that I actually use?