Hi,
I'm interesting to know what is the preferred way to go regarding to shaders performances.
( Yes, it is matter of profiling, but is there a preferred way ? )
Option 1: having one shader that does the same work all the time, and at some cases may do "empty" work.
For example the specular level is inputted from a texture. But in case we don't have a unique specular level pattern, the
inputted texture is white 1x1 pixels size texture.
I know that sampling texture can impact the performances, and according to some resources online, in modern GPUs it is preferred to
use more ALU's then textures sampling, but, Is the texture size count?
The plus side of this approach is that I'm reducing the amount of programs swap, which also contribute to the performances.
Option 2: Use pre-processors and split the work to many shaders. The GPU will work less, but we will have a lot of programs change.
Tnx,