Preparing the vertex and constant buffers for materials and lighting