You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a good way for me to flush a large array into a GLBuffer? Currently the setindex methods incur a huge amount of overhead for my purposes.
Context:
I'm rendering a bunch of arbitrarily colored squares on a window, and need to update the colors on every frame using data from a TCP socket connection. See the repo below for more info, not that it has much documentation at this point, but it's only about 100 lines of code) https://github.com/JMurph2015/LEDSimulator.jl
The text was updated successfully, but these errors were encountered:
Sorry, your code is a bit complex for a quick look at why this is slow.
I see you're using glBufferSubData, which should be relatively fast for large arrays.
Maybe you can speed things up, if you leave the buffer mapped, similar to this: https://github.com/JuliaGL/GLAbstraction.jl/blob/master/src/GLBuffer.jl#L117
Btw, any reason why you don't use GLVisualize for this?
Seems like you could easily save yourself from most of the code you've written there ;)
So, I actually figured out the glBufferSubData after the comment here, but it would be nice if the version in GLAbstraction supported something like this in broadcasting to make the call streamlined. When I was using the setindex! methods defined for GLBuffers I was ending up binding, calling glBufferSubData, and unbinding 36,000 times or so. My stuff runs pretty acceptably fast now. (and sorry for subjecting your eyes to that code, it looks like a warzone right now.)
Re GLVisualize: Mainly that it was such a simple layout that it was pretty easy to do in closer to raw OpenGL without having to learn a new API for it. GLVisualize didn't seem to be geared toward polygons so much as data sets.
Is there a good way for me to flush a large array into a GLBuffer? Currently the setindex methods incur a huge amount of overhead for my purposes.
Context:
I'm rendering a bunch of arbitrarily colored squares on a window, and need to update the colors on every frame using data from a TCP socket connection. See the repo below for more info, not that it has much documentation at this point, but it's only about 100 lines of code)
https://github.com/JMurph2015/LEDSimulator.jl
The text was updated successfully, but these errors were encountered: