Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Vertex Array Inner Workings - OpenGL  (Read 1555 times)

0 Members and 1 Guest are viewing this topic.

FuriousPaladin

  • Newbie
  • *
  • Posts: 1
    • View Profile
Vertex Array Inner Workings - OpenGL
« on: October 01, 2017, 04:54:29 pm »
Hello People! Happy to be joining the community today.
For my first post, I'd like, if possible, some clarification about the Vertex Array's inner workings.

As I understand it, all of the Vertex Array's data are passed to the gpu on each draw call.
Is my assumption correct? And if so, isn't that quickly becoming a performance bottleneck?
(For large chunks of vertices, as I seem to be in need of).
How expensive do you think that pass is? Relatively Speaking.
Perhaps I don't mind passing all the data each time they are altered,
but I know it's possible in opengl to pass the data only once and store them on the gpu, on a buffer.
That would be my desired behavior. So that I don't have to pass all the data each frame.

What about instancing? I know it's possible in opengl, relatively easily,
as shown here: https://learnopengl.com/#!Advanced-OpenGL/Instancing
Is it even possible in SFML?

The problem is, as I see it, that SFML uses the legacy API,
of which I know almost nothing about, to be honest.
So I know not what of the things I have in mind, are actually even possible with it.
And I'm having a little bit of trouble mixing (modern) opengl with SFML,
despite being able to use opengl just fine with the windowing module.
(And yes, I've read the relevant tutorial, I can't make it work properly)

So, would it be easy to tweak sfml's source code to handle this problem?
In a modern opengl way? And if so, where should I look?
Or should I forget about it and find a way to mix opengl and SFML,
and handle this specific problem in opengl?
Is it even worth, performance-wise to mix SFML with modern opengl?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Vertex Array Inner Workings - OpenGL
« Reply #1 on: October 01, 2017, 05:48:30 pm »
As I understand it, all of the Vertex Array's data are passed to the gpu on each draw call.
Is my assumption correct?
Yes.
And if so, isn't that quickly becoming a performance bottleneck?
(For large chunks of vertices, as I seem to be in need of).
Maybe.
How expensive do you think that pass is? Relatively Speaking.
Depends.
What about instancing? I know it's possible in opengl, relatively easily,
as shown here: https://learnopengl.com/#!Advanced-OpenGL/Instancing
Is it even possible in SFML?
No.
So, would it be easy to tweak sfml's source code to handle this problem?
In a modern opengl way?
No.
And if so, where should I look?
Probably everywhere in sfml-graphics.
Or should I forget about it and find a way to mix opengl and SFML, and handle this specific problem in opengl?
At the moment, probably.
Is it even worth, performance-wise to mix SFML with modern opengl?
There should be no reason not to do it.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).