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 iTzsKiLLeR · Sep 07, 2020 at 09:32 PM · bugcubeverticesperformance optimizationprimitive

Why does one primitive Cube have 100 vertices??

I am having some performance issues with my Game. I have over 8 Mio vertices. So i tried to reduce the number. But what surprised me is that even when i start a new project and only add one primitive cube. My Vertex count is at 104. It is at 4 without the cube. The Skybox is arroud 4k vertices so i have turned it off. But why does one primitive cube add 100 vertices to the scene. Vertices are the corners of the Triangles that make up the mesh if I understand correctly. Each side of of Cube is devided into 2 Triangles so even if some of the corners are used multiple times it is never 100 vertices. I dont get it help pls

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Sep 07, 2020 at 09:43 PM

You probably talk about Unity's rendering statistics window? The vertex count does not necessarily correspond to the physically present vertices but how many times they are processed during rendering. This includes each pass your material uses as well as any auxiliary passes like shadow or light passes.


A primitive cube has exactly 24 physical vertices, 4 per face. So it might be rendered 4 times which would add up to 96 and maybe an additional full screen rect for post processing (or something like that). The number of vertices is pretty irrelevant for most hardware. The SetPass / draw call count is way more important.

Comment
Add comment · 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
0

Answer by iTzsKiLLeR · Sep 07, 2020 at 09:52 PM

Are you sure it says that for Mobile you should not be over 200.000 vertices i have read here: https://docs.unity3d.com/Manual/OptimizingGraphicsPerformance.html. Also i dont get how it has 24 vertices? A Cube has 8 corners. So the corners are counted multiple times? Sry I am very new to performance optimazation textures and meshes. Thx for the quick reply

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 iTzsKiLLeR · Sep 07, 2020 at 09:55 PM 0
Share

I mean one vertex is being used by 6 Triangles if I am not mistaken. But it is couted multiple times?

avatar image Bunny83 iTzsKiLLeR · Sep 07, 2020 at 10:53 PM 1
Share

A vertex is made up of several vertex attributes. The position is just one of those attributes. The others are the vertex normal as well as UV coordinates. Whenever any of those attributes is different, you have to split the vertex. A cube is made of 6 faces. Each face requires a unique normal vector in order to render the face properly. So you can not share the vertices at the corners since 3 faces will meet at each corner. That's why you need 3 times 8 vertices. Or to state it in a way that makes more sense: 6 times 4 vertices. Since each face is made up be two triangles that form a quad, each face requires 4 distinct vertices. I've explained that countless of times already. For example over here.


About performance optimisations: $$anonymous$$obile is a topic on its own. A huge issue with older mobile devices is that you generally have a very limited platform. So you're usually low on pretty much everything. You usually don't want to use Unity's Standard shader for mobile unless really necessary. The Standard shader is a monster. Have a look at this page.

avatar image revolute Bunny83 · Sep 08, 2020 at 02:17 AM 1
Share

Actually this is caused by realtime shadow pass. Depth pass to set depth map before rendering shadows, 2 extra draw calls for the shadows itself, final extra to render the mesh itself. 24 * 4 + 2 full screen blit ( a quad ) to be exact. Remove light or shadows, and you will get 28.

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

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

Gfx.WaitForPresent is limiting fps to 30-45 with Application.targetFrameRate = 60; 1 Answer

How to snap a "Cube" ? 1 Answer

Get vertices inside a box collider 1 Answer

Adding texture to vertex ,I don't want to apply texture each vertex 0 Answers

Primitive Cube Texturing Help 3 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