-
Notifications
You must be signed in to change notification settings - Fork 78
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
Performance with no QNANO_USE_RENDERNODE #33
Comments
Qt Quick scene graph is able to "batch" some Qt Quick items into same draw calls. This only works for certain items and increases performance only when number of visible Qt Quick items grows bigger. QNanoQuickItems (QQuickFramebufferObject) likely can't be batched by scene graph. Just to make sure, tested QNanoPainter vs. QQuickPaintedItem and for both the amount of batches increases with the amount of items. So yes, this is expected behavior. I don't know your exact use-case but if the amount of visible items is hundreds I think you should consider custom rendering those inside a single QNanoQuickItem instead, like e.g. in mouse_events example. |
Thanks for the quick response.
I also was checking the possibility to use QNANO_USE_RENDERNODE but I stucked on rotate and scale actions. Any thoughs? |
Sure custom items in QNanoQuickItem can have own position, rotation, scale etc. Just as an example here is small patch which would add those into mouse_events example. Looks like this with ~1000 items (gif doesn't do justice to quality & performance): |
Hi again, |
Hi Again, |
Would need to understand your requirements better... But if you have thousands of quite complicated items which all are not changing/animating then yes, you probably should not redraw all from scratch. Like you should not paint items which are outside current viewport. And you could for example cache all static items into FBO which is fast to render and just repaint changing items. Or you could use lod to reduce details when zoomed out and amount of items grows. But you should think these optimizations no matter are you using QNanoPainter, Qt Quick items or raw OpenGL. =) |
yeah, you tips have been being really useful.
Sorry for the extension of my answer, I hope now it is more clear, at least clear enough :) |
Thanks for explaining your needs! Yes, I think layering could be best approach for that sort of whiteboard/painting application. Please inform how you get it working and good luck!! |
How can the "2 layers" implementation be done easily to handle background vs "active/in-progress items"? Got any examples? (Likewise examples or suggestions on use of QNanoPainter::save() and QNanoPainter::restore()). I have a lot of background items that I cache as QRects instead of redrawing each time but since there can be hundreds-thousands of these, it is certainly a performance hit, especially if the number of "foreground" items become large. Take, for example, what happens when I zoom-in on audio "waveforms" which "thins" progressively less data (or when zooming out the waveform is thinned). Note the glitching on the scrolling text carousel when that happens. Which is already somewhat "at the limit" since it's pulsing to the beat of the playback music :-) https://www.youtube.com/watch?v=qEn-YUXBERc (have to jump around alot in the demos or you get a copyright strike from youtube :-) finally succeeded... ) |
Also, as a separate request @QUItCoding would it be possible to commit to 'master' those cool changes you did to the gallery app above in https://github.com/QUItCoding/qnanopainter/files/2452024/qnano_mouse_events_rotate_and_scale_diff.txt The only change is to update to the current suppress-warnings "style" of last batch of updates is the following:
|
@NielsMayer Nice! Quite a bit rectangles there so no wonder it needs to be tuned to perform! For this specific case "2 layers" could mean making bottom graph a separate QNanoQuickItem as it seems to be static? Just take the seeking arrow to separate QML item on top of it. This item could have "layer.enabled: true" so it will be cached and not repainted until it changes. For upper zoomable view it is important to not paint things which are out of currently visible area, probably you are doing that already. There also seems to be some LOD already in use (when zooming out enought lines graph disappears). Bars in graph currently have slightly rounded corners which increases vertices count, you could check how removing rounding & borders affects performance. Are the scrolling text and elapsed / duration on same QNanoPainter item or separate QML items? You could try separating them also. Please keep us informed how your application progresses! |
Hi,
We are making an application that is generating dinamically QNanoQuickItem Custom Items, all the items created are sharing the same parent.
The behavoiur is nice but we are getting some "issues" when overloading the number of items created.
We are adding
qputenv("QSG_RENDERER_DEBUG", "render");
to check how is the render behaviour and we can see the number of "batches" is incrising each time we create a new QNanoQuickItem. And that is doing our render effect degrade the performance because of that.As additional point, we have checked the same app but based on QQuickItem Custom Items, and in this case the number of "batches" is not incrised and not degrading the performance behaviour.
Is this the common behaviour and I have to assume it, or is there a way to change this behaviour?
The text was updated successfully, but these errors were encountered: