Author Topic: Merge Polylines for speedup  (Read 1848 times)

Offline Thorsten

  • byte
  • *
  • Posts: 2
    • View Profile
Merge Polylines for speedup
« on: November 15, 2015, 06:42:20 pm »
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12298
    • View Profile
    • http://www.jpct.net
Re: Merge Polylines for speedup
« Reply #1 on: November 16, 2015, 10:21:32 am »
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!?

Offline Thorsten

  • byte
  • *
  • Posts: 2
    • View Profile
Re: Merge Polylines for speedup
« Reply #2 on: November 17, 2015, 08:48:58 am »
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.