Performance Problems with Unity Line Renderer

Hi there!

We’re trying to visualise various routes in a city. We already managed to use unity’s line renderer component to plot the corresponding coordinates, by converting the Lat/Long values to local space coordinates for the line renderer.
However, we’re starting to see low frame rates and we’ve identified the line renderers as the culprit using the profiler.
We would really appreciate if anyone could provide ideas for improvements or alternative approaches!

Hi @akikhia, welcome to the community!

You might have better luck with using Unity’s Splines package to draw the routes. We actually use this package for polygon spline clipping in Cesium for Unity. Based on what we saw during development, it should be possible to build a spline dynamically at runtime.

I’ve never tried this myself, so I can’t claim whether it would provide a performance improvement over the line renderer. An alternative might be to build a mesh yourself based on local space points, or to position meshes on those points. But that could be tricky.

Let us know what you decide to try out, and how it goes!

Hi Janine,

thx for your response. I would like to unterstand the basic idea behind Splines better. We want to visualize streets for which we have WGS84-LineStrings as a data set. If I got it right we need to transfer the WGS84 Lat/Lon coordinates into Splines. Splines are using float3-Vectors for positioning. I assume we need to use CesiumGeoreference.TransformEarthCenteredEarthFixedPositionToUnity to create float3-Vecotrs, right?