#Grid not rendering on screen.

6 messages · Page 1 of 1 (latest)

fresh heron
#
#version 460 core
layout (location = 0) in vec3 Position;

void main()
{
     gl_Position = vec4(Position, 1.0);
}
#
#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);

fresh heron
#

In render doc i see the vertices being called but in the vertex shader there's nothing being passed