Implementing flat shading