This (ab)uses the HLSL preprocessor to compile shaders for specific use cases. This significantly improves performance without having to reduce the number of shader switches.
It could be improved further to separate addressing of vertex and pixel shaders to reduce code redundancy. The only issue there is that it would require basically re-inventing the wheel by implementing would effectively be a custom ID3DXEffect, so whether or not it's worth the time is still unknown.
This (ab)uses the HLSL preprocessor to compile shaders for specific use cases. This significantly improves performance without having to reduce the number of shader switches.
It could be improved further to separate addressing of vertex and pixel shaders to reduce code redundancy. The only issue there is that it would require basically re-inventing the wheel by implementing would effectively be a custom
ID3DXEffect
, so whether or not it's worth the time is still unknown.