Material now passed to shader as integer rather than float.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user