GreasedLines rendering performances

Hello there :slight_smile:

I’m working on a project where I’ll need to render thousands of wires (electrical cabling).
At first I used MeshBuilder.CreateTube, with the idea in mind to “optimize later”. Now that I want to improve perfs, I’m turning myself toward GreasedLines.

And I’m surprised to notice that GreasedLines are showing much worse perfs than 4 times the amounts of vertices with tube meshes :


GreasedLines, running ~25 FPS on my machine, 1.47 M active indices


Tube Meshes, running ~50 FPS on my machine, 5.88 M active indices


So, considering the ratio of active indices and FPS, GreasedLines are being 8 times slower than an actual tube mesh, here… :thinking:

Maybe @roland has a clue of why is it so ?

This might interest @sebavan as well.

Sorry, I can’t squeeze more from it :smiley:

GRL instance and lazy mode:

I could :smiley:

  instance.alwaysSelectAsActiveMesh = true
  scene.freezeActiveMeshes()

Hey @roland
I’m coming back to you on this topic.
I’m still struggling with GRL due to an exponential time to create them, even in instance + lazy mode.

Please have a look at the build times (taken from your PG, only N pts changes)

As you can see, the build time is squared. (pts x5 → time x25, pts x2 → time x4)

I’m working on a project where I need to draw from 100k to 400k lines (of some dozens of points) but I’m stuck on a huge build time.

Interesting… I’ll put this one on my list as well. Since I was away for a pretty long time, I am going trough my forum notifications one by one and my TODO list is growing exponentially too :smiley: