Timeline for pyOpenGL draw loop - slow with just 1500 items to draw
Current License: CC BY-SA 3.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 23, 2016 at 17:15 | vote | accept | MalphasWats | ||
| Dec 23, 2016 at 16:59 | answer | added | Krythic | timeline score: 1 | |
| Dec 23, 2016 at 16:43 | comment | added | Krythic | Give me a moment to hop on my computer. | |
| Dec 23, 2016 at 14:09 | comment | added | MalphasWats | @krythic - Your comment made me look at all this again and realised I'd made a fairly fundamental error in my understanding - I was generating and then rewriting all the same data into a buffer each time around the draw loop, instead of just redrawing the buffer as it was (I'll work out how to modify just the bits that change later!). If you want to write an answer along these lines, I will gladly accept it as the answer. Thank you | |
| Dec 18, 2016 at 3:53 | history | tweeted | twitter.com/StackGameDev/status/810332255684063233 | ||
| Dec 17, 2016 at 17:29 | comment | added | CodeSurgeon | @MalphasWats First thing I would check like Krythic said is to see whether the numpy array creation or the opengl passing part is slower. Try commenting out the gl functions in your draw function and see if your fps changes. If not, then the way you are creating the tile data is the bottleneck. | |
| Dec 17, 2016 at 16:28 | comment | added | MalphasWats | I'm trying not to over optimise, just get a baseline level of performance. I only want to make a really simple tile engine with a bit of dynamic lighting later, but I keep stalling at the same place no matter what I try - I can't draw a decent number of tiles fast enough to even consider adding fancy effects. It's frustrating because other people seem to manage it but I can't even get past this basic hurdle. | |
| Dec 17, 2016 at 16:00 | comment | added | Krythic | If you're over-optimizing for performance, you would be happy to know that even Minecraft uses immediate mode for rendering. Each chunk is stored into a display list. | |
| Dec 17, 2016 at 16:00 | comment | added | MalphasWats |
The way I've set up my test app is I have a field of tiles (that don't really change) and a sprite that moves 1px each update cycle (which is about once a frame at the moment, update runs in glutIdleFunc().
|
|
| Dec 17, 2016 at 15:57 | comment | added | Krythic | You need to initialize the array once and reuse it until it becomes invalidated by geometry changing. I haven't looked at your code, but this should be possible to implement in every situation. | |
| Dec 17, 2016 at 10:59 | comment | added | MalphasWats |
I am - I don't like it but I don't know how else to do it? glBufferData will only accept a numpy.array
|
|
| Dec 17, 2016 at 2:30 | comment | added | Krythic | Are you creating arrays in your render loop? It looks like it. | |
| Dec 17, 2016 at 1:13 | review | First posts | |||
| Dec 17, 2016 at 5:24 | |||||
| Dec 17, 2016 at 1:12 | history | asked | MalphasWats | CC BY-SA 3.0 |