Yes, your boss can alter your productivity, working environment is also a factor in producing good quality output. How can you work in an environment wherein shouting and cursing from the boss is a normal everyday scenario? As much as you would want to be objective and understand how stressed they are, you do have a share of your "I'm so pissed off days!" You can get used to the situation but you can never be immuned to the effect it will cast on your mental, emotional and moral well being.

On the other hand, a good boss, who lives and leads by example can always be a good inspiration and motivation in giving out 100% work effort and efficiency.