1
Feature requests / Re: Support drawing multiple arrays of same OpenGl mode within one call
« on: April 08, 2015, 05:16:57 am »You have to remember, OpenGL is a pipeline. Pipelines don't like to stop and if you force them to they will annoy you with bad performance. You will get much better performance by shaping your geometry into "pipeline friendly" geometry instead of thinking of how to save draw calls through secondary data structures. Saving draw calls only benefits you if you are driver-bottlenecked, which to be honest almost never happens in a typical SFML application. When dealing with large amounts of geometry in SFML, it will probably be the memory bandwidth that kills performance, since all the data has to be transferred again and again every single frame.
Those are all really good and worthwhile points worth considering. I don't necessarily see why the two functions I referenced would particularly interrupt the OpenGL pipeline but I don't have a tremendous amount of experience with the inner workings of OpenGL so I'm more than willing to concede that point. Memory constraints are also obviously a big concern however for my particular needs in this project, which again may be strictly specific to me, my solution seemed to make stricter use of memory compared to the basic implementation. Mainly I found that with the way things currently are I would either be forced to add a large number of unnecessary vertices to describe more generic primitives rather than use OpenGL's abstractions such as triangle strip etc; or alternatively require additional instances of VertexArray, which as a C++ class with several functions and members such as std vector, does come with its own overhead that could add up depending on how many calls need to be made. In my particular case, this solution allows me to make the most of my memory and use only one instance of a (modified) VertexArray while still using only the lowest number of vertices as needed to describe my geometry (and some additional book keeping variables to make the new OpenGL calls work but those are trivial in comparison).