-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance in multiple areas #115
Comments
As far as "optimization" goes, there's not much I can do. I don't manage any of the rendering and graphics component of the application. That's all on jMonkeyEngine and I just use that to create the graphics. My guess is with a graphics card that nice and you are getting shitty performance, it's just not being utilized since it's AMD. |
Here in this scene you can see how it only makes 20fps with shadows on low |
Can you also open that file again, press F3, and take a screenshot please? |
I'm testing it out now and I notice I'm getting only about 30-45 fps myself, so you are right with regard to the frame drop. I will spend some time trying to find the root cause of it. |
After performing some profiling, I noticed the call to Sequencer.microsecondLength was taking a considerable amount of time per frame, thereby reducing the average FPS. To resolve this, the value is now calculated lazily--since the length never changes, this should be safe. While this is not a direct "end all be all" solution to #115, I can only imagine that this contributes to the problem presented in that issue, since it does directly relate to the overall performance of the program.
I've determined the root cause of this slow down is a combination of both many on-screen objects and my event collection system. During the past month or so, I've been doing an entire refactor of the event collection system. My initial implementation that has been used up to this point is pretty naïve and causes lagging when scaled up (many instruments). So it is a contributing factor to the reason why this MIDI file slows down (particularly, the pitch bend control for each instrument is taking a considerable amount of frame time). I still have some work to do until it is entirely refactored, but I am close. I have changed the logic of almost every instrument to use this new method. So here is what remains that needs to be refactored:
This new system I'm developing also supports seeking (jumping around the file) so this is also related to #98. Hopefully when I have the event collection refactored, it will only be a factor of the performance of the graphics card (or at least a less significant factor). |
I also just found out that the SSAOFilter (screen space ambient occlusion) was adding a lot of extra overhead! Gonna try to tweak this to improve its perfomance. |
Improves performance significantly!! Contributes to #115
It was adding a substantial amount of overhead loading a 6000x6000 texture, I only did this previously because I didn't want it to be smoothened, but now it is actually being loaded nearest-neighbor. Contributes to #115
At this point I've entirely refactored the event collection system. Performance, as it relates to the computation of animation—not necessarily rendering, although that has been optimized and is configurable—has been significantly optimized. |
This MIDI file runs at a smooth 60 FPS now! |
Describe the bug
A clear and concise description of what the bug is.
The enhanced shadows REALLY need some optimization, specially with high amounts of instruments showing up at once.
I have a RX580 4gb (and ryzen 3700x), and it is struggling to get to 60fps and sometimes even 30fps and with enough instruments not even 15fps with the shadows at low (doesn't change the performance much with medium and high shadows).
If I put the enhanced shadows on OFF it runs 144fps easily, so these shadows are really slowing down the performance and they should be optimized
IDK if it's because this RX580 is a AMD card and amd card windows drivers are NOTORIOUS for bad OpenGL performance compared with nvidia or even intel, if midis2jam2 is using OpenGL that could be a factor and adding vulkan support would fix it
Offending MIDI file
Upload the MIDI file that causes the bug here.
Any midi with more than 10-20 instruments or more showing up at once really, compare the performance on the same midi with shadows off vs shadows on low/medium/high)
Expected behavior
A clear and concise description of what you expected to happen.
The drop of FPS shouldn't be as big just from shadows on an rx580 mid end card, this card should be more than enough to run midis2jam2 at more than 60fps all the time
System
Provide your OS, and computer specs if applicable.
windows 10 21H2, 2x8gb of ddr4 2666mhz, ryzen 3700x, rx 580 4gb
The text was updated successfully, but these errors were encountered: