I'm having problems displaying level data on the screen. I have a shader that uses the cube correctly, but not the level.
Here are the settings for my VBO, VAO and IBO:
void ZoneMesh::buildData() {
Here is my vertex structure:
struct Vertex { float x; float y; float z; float u; float v; float normX; float normY; float normZ; };
Here are the relevant data elements in the ZoneMesh class:
Vertex* vertices; short* indices; GLuint vbo; GLuint vao; GLuint ibo;
Vertex shader:
Fragment Shader:
Rendering:
shader.Use(); // Testing - render the first 50 meshes for(int i = 0; i < 50; i++) { glUniformMatrix4fv(shader("camera"), 1, GL_FALSE, glm::value_ptr(MVPMatrix)); glEnableVertexAttribArray(shader["position"]); glBindVertexArrayAPPLE(zone.getVAO(i)); glDrawElements(GL_TRIANGLES, 500, GL_UNSIGNED_SHORT, NULL); } shader.UnUse();
Using render / shader is not a problem. MVPMatrix is ββcorrect. I have cubic rendering correctly above it. The zone is not displayed, though.
source share