unitycoder / UnityPointCloudViewer

Point Cloud Viewer and Tools for Unity
https://assetstore.unity.com/packages/tools/utilities/point-cloud-viewer-and-tools-16019?aid=1101lGti
131 stars 15 forks source link

duplicate code parts #109

Closed nvoelzow closed 11 months ago

nvoelzow commented 3 years ago

what's the reason for the duplicate code for A/B (like LoaderWorkerThreadA/LoaderWorkerThreadB, ReadPointCloudThreadedNewA/ReadPointCloudThreadedNewB etc) and could these be merged to make it easier to change things (not having to duplicate every little change would be great)?

unitycoder commented 3 years ago

yes, thats the goal. and there was some issue previously that was solved with this 2 paths.. but yeah, will be merged eventually.

also for info, some user tested splitting it into 8 separate loader threads, but it didn't help much in performance.

nvoelzow commented 3 years ago

indeed, the performance doesn't really benefit from that - I just merged them here and tried it with different numbers of threads, but since everything is bound to the MainThread to transfer the buffers, the speedup is minimal as basically only the loading from disk is multithreaded. But having it merged makes it much easier to modify any of the loading/downsampling part... let me know if you want my currnent version of the file - I did however also remove things like the pre-2019 ifdefs and pointing functionality to get a better overview

unitycoder commented 3 years ago

sure, can email me that (will save me time, thanks), i can add those ifdefs back, personally still using 2018 often.

unitycoder commented 11 months ago

this is added in next update v2.80! thanks

it can help on clouds with small tiles, 2 threads loading: 2threads

-- 16 threads loading: 16threads