Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by rustyruss1985 · Sep 29, 2017 at 05:33 PM · renderingspeedlinerendererglvbo

fastest way to draw millions of lines?

hi, i'm trying to create a multi-platform tractography visualization tool, to visualize datasets such as this: http://brainsuite.org/wp-content/uploads/2015/02/tracts2.png

basically, each dataset contains hundreds of thousands of "streamlines" which are just a bunch of connected line segments (typically, 50-100 points per streamline).

i've tried using immediate mode (GL.Lines) but the performance is quite poor, i also downloaded the fastLineRenderer asset and it didn't really improve much on my device, and i hear that vectrosity is much the same.

i was wondering if there is a faster way to draw lines (or any shape for that matter) than GL.Lines immediate mode, in the onPostRender method? based on some other applications i've seen that do the same thing i'm trying to do, i should be getting 5-10x faster than what i'm getting with GL.Lines. i've read that VBOs may help, but i don't know much about them or if its even worth getting into.

thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by FortisVenaliter · Sep 29, 2017 at 07:17 PM

You can make Mesh objects with line geometry. I would go that route. When you set the indices, just choose MeshTopology.Lines.

But for an image like the one you linked, you're going to have a very hard time getting that to render in real-time, I think.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rustyruss1985 · Sep 29, 2017 at 10:28 PM 0
Share

will that be faster than GL.Lines?

avatar image FortisVenaliter rustyruss1985 · Oct 02, 2017 at 07:01 PM 0
Share

Almost certainly, because the mesh would be stored in VRA$$anonymous$$ rather than having to be sent to the GPU each frame.

avatar image rustyruss1985 FortisVenaliter · Oct 02, 2017 at 07:37 PM 0
Share

cool thanks, this really sped up my code (haven't quantified by how much yet, but it looks to be at least 5x faster possibly more (vs GL.Lines), based on how my framerate has improved).

now i'm gonna have to look into customizing the color of each line segment on the mesh, and hiding/displaying different lines on the mesh, according to user interactions.

i'll post some code + detailed comparison in a day or two, thanks again!

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

118 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why Line Renderer draw in delay ? 1 Answer

Why drawing GL quads is so slow? 1 Answer

Issue with trail renderer alignment 0 Answers

Unusual Unit Slowdown 0 Answers

URP Doesn't Pass Camera.Current to OnRenderObject? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges