implemented shader optimizations