Merge Polylines for speedup

Started by Thorsten, November 15, 2015, 06:42:20 PM

Previous topic - Next topic

Thorsten

Hi everyone,

Im trying to develop a little VR App with the Cardboard Api. With the help of some posts of this forum I got the basics work. I try to display some kind of math objects as wire nets. For this purpose I'm using polylines. In the moment I use just very short lines connecting just two points, because that's the way I got the data of the lines. With about 8000 lines the app is too slow to enjoy any VR experience.
Would less, but longer Polylines increase the speed? If so is there an easy way to merge two intersecting lines? Is there anything else I can use as speedup?

Best,
Thorsten

EgonOlsen

Today's graphics chips are not optimized for line drawing, which can lead to performance problems when using them excessively. So yes, less but longer lines should be faster (but I'm not sure by how much). I'm not sure if there's an easy way or not in your case. All I can say is, that there's no build-in way to do it. You have to do it by yourself.
Just keep in mind that updating the polylines constantly has a performance impact as well. Or are you updating them anyway in each frame, which can be another reason for low performance!?

Thorsten

Thanks for the advice, Then I will see if I find a way to draw larger segments. I will report if it brought any advantage.