slimming down and optimization of shadow shader