Material now passed to shader as integer rather than float.

This commit is contained in:
David Williams
2014-05-24 22:53:10 +02:00
parent 07b9cf05fa
commit 99cf75e902
2 changed files with 9 additions and 8 deletions

View File

@ -92,7 +92,8 @@ public:
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, normal)));
glEnableVertexAttribArray(2); //We're talking about shader attribute '2'
glVertexAttribPointer(2, 2, GL_UNSIGNED_BYTE, GL_FALSE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material)));
GLint size = (std::min)(sizeof(MeshType::VertexType::VoxelType), size_t(4));
glVertexAttribIPointer(2, size, GL_UNSIGNED_BYTE, sizeof(MeshType::VertexType), (GLvoid*)(offsetof(MeshType::VertexType, material)));
glBindVertexArray(0);