Some opengl optimization.