Page 1 of 2
Display performance decreasing a lot when segment tool is enabled
Posted: Wed Oct 05, 2022 8:54 am
by ryukisai
Hey there, i noticed that the display performance (FPS) is decreasing a LOT while the segment tool is enabled.
On my laptop, with a ≈3 Mpts cloud, the display is perfectly smooth (50 to 60 fps), but when i open the segment tool it drops to ≈ 7 fps on average. I’m here referring to fps while moving the cloud around.
Is that expected / normal behavior?
Note that this laptop is nothing mighty (GPU is an Nvidia MX130). On powerful PCs the effect is less visible but still present.
Thanks in advance for any feedback!
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Sat Oct 08, 2022 9:18 pm
by daniel
Yes, that's possible, because in this mode CC changes the display mode (instead of loading the points on the GPU and display them all at once, it has to choose only a subset dynamically).
Still, it's a bit strange to observe such a drastic drop... Especially for such a small cloud. Is the laptop switching automatically to use an Intel chipset instead of the NVidia card maybe? (this can be seen in the Console, at the beginning).
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Sun Oct 09, 2022 12:17 pm
by PablerasBCN
I confirm that as you go on with segmentation it gets choppier to the point I've to save what I've done and continue the segmentation by relaunching the tool.
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Sun Oct 09, 2022 2:47 pm
by daniel
Was it better before, or is it a general observation?
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Thu Oct 13, 2022 2:01 pm
by ryukisai
Honestly i'm unsure if it was better before or always like that…
I usually work on decent computers so i did not really pay attention to this performance drop before honestly. However on my field work laptop it's pretty obvious.
Also worth mentionning, i used to work only in orthographic mode, without a 3d mouse. Now i'm trying to improve my workflow, i got myself a spacemouse and i'm beginning to use it together with viewer-based perspective and the new far clipping plane. So i need much more movement of the view.
I'll test with 2.11 and report!
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Fri Oct 14, 2022 9:31 am
by ryukisai
Hey! Ok i just tried with a ≈4 Mpts cloud on 2.11.3 on our nice processing PC, it's the same, when i wiggle the cloud in the 3d view i get 55 to 60 fps when the segment tool is inactive, 5 to 10 fps when the tool is active and on pause.
Also worth mentioning: the GPU and CPU usage only marginally increases between the two,
GPU is 30 to 40% in the 1st case, 40 to 48% in the second.
CPU is 4 to 7% in the 1st case, 7 to 9% in the second.
Is there a way to change CC so that the display mode/buffer changes only when you begin a polygon (i.e. clicking the first vertex)??
In my mind it's not needed before that (but i'm not seeing the whole picture and might be wrong)…
I tried to have a look at the code to find this change, but honestly i confess it's beyond me…
Do you want me to create a github issue for this? Thanks anyway :-)
edit: our processing PC does not have an integrated GPU, so the performance drop can’t be linked to a that.
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Sat Oct 15, 2022 7:59 am
by daniel
Yes, the main difference between the 2 modes is the transfer from CPU to GPU memory (in the standard case it might not even be needed, or in the worst case a big block of memory is copied at once, while in the segmentation mode, we always have to copy them and it takes time to pack the data before sending them to the GPU).
I modified the code so as to avoid enabling the 'visibility array' right from the start, but it will only speed-up things until the first segmentation is performed. Of course, after this point the number of visible points might be much smaller. Or the user can close the tool and restart to speed up things a little.
I'll warn you when the online version will be updated.
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Sat Oct 15, 2022 5:09 pm
by daniel
The new 2.13.alpha version is now online.
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Mon Oct 17, 2022 4:27 pm
by ryukisai
Hey Daniel, i just tried, that's a great improvement! And thanks to your feedback i now understand better what's happening.
The visibility array depends on the point of view, that's why it needs to be "uploaded" to the GPU every time the display is updated?
Speculative/candid: What if instead of handling this with a visibility array on the source cloud, we used a copy of the resultant cloud? We would need more ram for sure but then also only 1 write operation per segmentation, isn't it?
Please take into account that i'm not a programmer so ignore the above paragraph if this is impossible to achieve / would not help / stupid! ;-)
Anyway, this change makes it possible to automate stuff in order to get the best performance all the time.
I think i'm going to try and make an autohotkey script to automatically run when the 1st segmentation is done, close the tool, deal with the results and restart it. I'll let you know if that works (could help other users).
Thank you!!
Re: Display performance decreasing a lot when segment tool is enabled
Posted: Tue Oct 18, 2022 8:25 am
by ryukisai
Hey! So this simple autohotkey code is a way to automate the end of the selection and restart of the segment tool in order to always get the best performance.
Code: Select all
#IfWinActive, ahk_exe CloudCompare.exe ; Whenever the active window is CC
<!o:: ; Whenever Alt+o is pressed:
MouseGetPos, xpos, ypos ; Gets the current cursor position
Send, o{Enter} ; Ends the selection with "o" and the segment tool with {Enter}
Click, 95 118 1, Left ; Click in the DB tree to focus it (x y might vary depending on your settings)
Send, {End}{Up}{Space}{Down} ; hides the "remaining" cloud and selects the "segmented" cloud
Click, %xpos% %ypos% 0 ; Goes back to the cursor's original position
Send, t ; Re opens the segment tool
return