From what Ive read over the years, from many sources,
putting an IF in a shader, ESPECIALLY a pixel shader, is 'frowned upon'.
In much the same way as a GOTO is frowned upon in any BASIC language.

Mostly, as far as I can tell, its because GPU hardware is optimised/designed primarily for
color/position calculations (VECTORs), rather than logic/arithmatic calculations like for/if.

So using an IF in a pixel-shader is 'inefficient' at a hardware level, and can therefore
cause a shader to be significantly slower because IF itself is so slow...


Thats my theory anyway. Ive never seen a 'concise' explaination of why...

And Im going to look into the 'saving' the shader result into the entities 'skin' later tonight.
I never got a chance to do ANYTHING last night...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial