Commit be6417c0 by Philipp Adolf

Add padding to Vertex

parent 188a8f55
...@@ -370,8 +370,8 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index) ...@@ -370,8 +370,8 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index)
// Draw Vertex Array // Draw Vertex Array
f->glBindBuffer(GL_ARRAY_BUFFER, entries[index].VB_handle); f->glBindBuffer(GL_ARRAY_BUFFER, entries[index].VB_handle);
f->glVertexAttribPointer(positionIndex, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0); f->glVertexAttribPointer(positionIndex, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), 0);
f->glVertexAttribPointer(normalIndex, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)12); //12 f->glVertexAttribPointer(normalIndex, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)16); //3*4+4
f->glVertexAttribPointer(uvIndex, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)24); // 12+12 f->glVertexAttribPointer(uvIndex, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)32); // 12+4+12+4
f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, entries[index].IB_handle); f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, entries[index].IB_handle);
......
...@@ -17,8 +17,14 @@ ...@@ -17,8 +17,14 @@
struct Vertex struct Vertex
{ {
QVector3D pos; QVector3D pos;
float padding0;
QVector3D normal; QVector3D normal;
float padding1;
QVector2D tex; QVector2D tex;
QVector2D padding2;
Vertex(){} Vertex(){}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment