update shader and small optimizations