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 OnEd0t · May 15, 2020 at 11:45 PM · shadermeshvertices

Draw lines between vertices on a mesh

Hi, Basically i want to draw simple thin lines between vertices on say on a plain, and i dont mean lines on the edges i mean line between vertices so that even the vertices on the inside of the plain have lines between them, Note that i don't want the line to cross diagnolly. simply like this: (with the vertices being in the crossings of the lines, Obviously) alt text also the plain is proceedurally generated at runtime and vertices are going to be moving alot for different effects, meaning the lines have to always be between them and updating with their movement. is there a way to achive this,preferably using shader graph (so that i can adjust it for more lighting effects across the grid of lines).

also performance really matters to me. searched around to find nothing except those from like 2011 - 2014 and i feel like there has got to be a much easier way to so instead of the old methods

Comment
Add comment · Show 1
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 negasuki · May 16, 2020 at 08:26 AM 0
Share

your screenshot didn't upload

1 Reply

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

Answer by Bunny83 · May 16, 2020 at 12:30 PM

This question is a bit confusing. When you create your mesh procedurally you most likely are creating triangles. You can simply create a second mesh using the same vertices array but instead of creating triangles you can use a different topology. In your case you can simply use MeshTopology.Lines or simply MeshTopology.LineStrip.


In the "Lines" topology the indices will always form single line segments. So always 2 consecutive indices will represent a single line.
In the Linestrip topology the indices will form a strip of line segments. The the first index will connect to the second, the second to the thrid and so on. However AFAIK you can not simply stop a linestrip and restart it elsewhere since it's a continues strip of lines. With trianglestrips it's possible to use degenerative vertices to collapse the triangle between the end and the start of the new strip into a line which would be invisible. This is not really possible with linestrips. So the best choice is probably just "Lines".


If you need those lines to be a fix part of your mesh you might just add the lines as a submesh with its own material to the same mesh. However if you really want to use a shader to just draw the grid onto the mesh itself be aware that your mesh need to be unwrapped properly. So you have to have some kind of UV mapping in place. Also keep in mind if you're essentially rendering the lines in texture space they will be affected by perspective (if you use a perspective camera). So they will appear larger when they are closer to the camera. Here's a very simple example in shader graph how you can generate a grid. As long as you aligned the uvs and scaling correctly the "lines" would stay aligned with your vertices.

Comment
Add comment · Show 1 · 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 OnEd0t · May 16, 2020 at 04:38 PM 0
Share

Thank you, I Think that this is just what i need.

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

142 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 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

How to fill the empty room between vertices in a mesh? 0 Answers

Imported point cloud - section view 0 Answers

Meshes appears very dark than expectation 0 Answers

Additive based material not rendering on some objects 0 Answers

Vertex coordinates of mesh imported from Blender as fbx are all equal to 0,0,0? 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