Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by numberkruncher · Jun 12, 2012 at 02:21 AM · shaderiosmeshprocedural mesh

GPU performance with tris and verts

I am experimenting with various ways of implementing 2D tiles with dynamic paint/erase at runtime. To simplify performance at runtime I am considering leaving vertex data untouched, it would always represent the maximum number of tiles that the grid can contain:

 rows * columns * 4

  • When a tile is painted triangles are formed easily by calculating triangle indices.

  • When a tile is erased (given row and column) the triangle is somehow found and removed.

From previous shader discussions I have learnt that the number of vertices in a mesh is a massive contributing factor in terms of performance.

Will unused vertices incur additional overhead (with exception of data transfer)?

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
2
Best Answer

Answer by Eric5h5 · Jun 12, 2012 at 02:55 AM

Not really, since degenerate triangles are skipped over when rendering. However, performance-wise you'd be much better off leaving the triangles alone and uploading changed vertices. Number of vertices in a mesh isn't that big of a deal in most cases, relatively speaking; other things such as the kind of shaders used and number of objects (draw calls) can be larger factors.

Comment
Add comment · Show 4 · 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 numberkruncher · Jun 12, 2012 at 02:38 PM 0
Share

Thanks! "However, performance-wise you'd be much better off leaving the triangles alone and uploading changed vertices" Would you $$anonymous$$d expanding upon that?

avatar image Eric5h5 · Jun 12, 2012 at 11:56 PM 0
Share

Uploading triangles is several times slower than uploading vertices, so if you can leave triangles alone and upload vertices ins$$anonymous$$d of the other way around, it will be faster.

avatar image Bunny83 · Jun 13, 2012 at 12:33 AM 1
Share

@Eric5h5: I'm wondering why? Aren't both just data arrays? Does the GPU perform some postprocessing after the data is uploaded? Or is it cache related?

avatar image numberkruncher · Jun 19, 2012 at 01:35 PM 0
Share

@Bunny83 I have been experimenting and to me it seems that changing vertices is more expensive in my scenario. When vertices are changed you also need to change uvs, normals (all per-vertex data).

In my situation if I pre-fill a mesh with all grid vertices and normals, then all I need to do is change uvs, triangles and submeshes. I haven't experimented with the sub-mesh aspect of this yet...

Perhaps that will be the killer performance-wise. If that is the case I can just have an entirely separate mesh for each material as there is no obvious benefit to combining multiple materials into a single mesh.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

SpriteSheet/Mesh Hybrid to reduce overdraw on iOS? 2 Answers

How to achieve Assasins Creed fragmented shader effect? 0 Answers

How to cut a hole in a wall? 3 Answers

How to determine shader center? 0 Answers

How do I get mesh data into post-processing shader (or render a mesh shader to a texture)? 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