#Grid not rendering on screen.
6 messages · Page 1 of 1 (latest)
#version 460 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
So this is my shader for the grid
void DrawGrid() {
GLfloat vertices[] = {
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
-1.0f, 1.0f, 0.0f,
1.0f, 1.0f, 0.0f
};
glGenBuffers(1, &GVBO);
glGenVertexArrays(1, &GVAO);
glBindVertexArray(GVAO);
glBindBuffer(GL_ARRAY_BUFFER, GVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (void*)0);
glEnableVertexAttribArray(0);
}
//Grid
Grid.use();
glBindVertexArray(GVAO);
glDrawArrays(GL_LINES, 0, sizeof(vertices) / sizeof(GLfloat) / 3);
In render doc i see the vertices being called but in the vertex shader there's nothing being passed