Switching shaders versus disabling vertex attributes

Started by
-1 comments, last by ill 11 years, 2 months ago

I hear switching shaders isn't very good for performance, so it's good to sort by things like shaders and textures from what I understand.

Now one example is if I have meshes that are animated with skeletal animation and hardware skinning, and some meshes that aren't. If I want to apply the same material to two meshes, one animated and one isn't. Is it better to have two shaders that do the exact same thing, where the only difference is I have skeletal animation code and data being sent?

I'm working on a material system, and Ideally I'd like the material properties to not be concerned if the material will be applied to a skeletal mesh, billboarded particle, etc... The material system creates shaders depending on certain properites, and there also happen to be these additional options that need to be considered.

This topic is closed to new replies.

Advertisement