【发布时间】:2012-11-27 04:53:02
【问题描述】:
我不明白发生了什么!我有这个网格加载器,当我用它加载小网格时,我的程序可以正常工作,绘制整个网格。但是现在我用一个大网格(超过 100,000 个顶点)测试了这个程序,它只画了它的一小部分!是不是我的显卡有什么问题,比如一些疯狂的小限制或其他什么?
使用 LWJGL,我从他们的教程中挑选了一些代码:
private ByteBuffer indexBuffer;
...
// Create a new VBO for the indices and select it (bind)
indxBufId = glGenBuffers();
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indxBufId);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexBuffer, GL_STATIC_DRAW);
...
// Bind to the index VBO that has all the information about the order of the vertices
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indxBufId);
// Draw the vertices
glDrawElements(GL_TRIANGLES, indexCount, GL_UNSIGNED_BYTE, 0);
// Put everything back to default (deselect)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
【问题讨论】: