Opengl only sending vertex buffer once?

Hi
im new to opengl and im trying to make a mandelbrot set visualizer.

The only way i can think of to do this is to generate some vertex data that forms a quad that covers the entire screen and then send that to the shaders every time i need to draw (the shaders then calculate the colors).

But it just seems very wasteful (since the quad never changes or moves) to call glDrawArrays and send down the same vertex buffer every single frame.

Is there a way to tell opengl to just invoke the shaders using the last input, without sending any vertex buffers to the gpu?
that way i just have to send down the vertex buffer once and then i can just keep invoking the shaders

something like: glDrawAgain();
Last edited on
glDrawArrays doesn't send any buffer, whatever vertices it's drawing already exist on the GPU. Perhaps I'm misunderstanding?

If only a small amount of a data changes every frame, perhaps using uniforms would help? Just an idea.
ohh sorry i think i misunderstood how opengl works

i was thinking that the vertex buffer objects existed on the cpu and when i called a draw function it would send a copy of that data to the gpu

but i guess what actually happens is that when i first create the vbo and put data in it, it sends the data to the gpu and the draw call just tells it which buffer to use on the gpu.

This make much more sense, idk what i was thinking before. Thanks.
Last edited on
It confuses me, too (present tense, I still really only know the basics of OpenGL).

glBufferData is probably what's sending the vertices to the GPU in your code.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferData.xhtml

glBufferSubData can be called to update only a part of the buffer, for efficiency. Though if you're only sending 1 quad of vertex data, I don't think it matters much.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferSubData.xhtml
Last edited on
Topic archived. No new replies allowed.