• 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 bricevdm · Dec 21, 2009 at 01:49 PM · iphone

Polycount inconsistencies between tris and vertex

Hello everyone I've been exporting a bunch of assets for iPhone and as most people I got surprised by the very high triangle count in the engine. I looked at some other questions there and there such as this one:

http://answers.unity3d.com/questions/1466/why-is-there-such-a-huge-disparity-in-polycount-between-unity-and-maya

I'm very aware of a lot of the tech weirdness in polycounts, but that doesn't explain everything imho. I understand both uv borders and hard edges increase vertex count, so I did a quick test and exported a cube from my favorite package using collada.

Every edge is hard and every UV is split, so the final vertex count should be 6 faces 4 vertex > 24 vertex and 6 faces 2 triangles > 12 triangles. In the editor (publishing on iPhone seemed consistent by I didn't checked every time) the cube indeed show up as using 24 vertex (and this seems logically unrelated to the number of data stored per vertex, second uv sets, normals etc) but the triangle count is up to 32!

Where the hell does those 20 extra triangles come from? Even considering extra invisible triangles are generated by the stripper for better performance this number is HUGE. There is more extra triangles than uv shells, or even original triangles so there's no way those are used only to connect shells together. Even to the extreme case where every single triangle in the mesh is not connected to any of its neighbor and requires an extra triangle each time we're still not up to 32.

Could this be some sort of stripping error or related to maya/collada? or have I skipped some sort of mesh compression option somewhere? Could there be a mistake in the way the strips are generated in unity or something like that?

Thanks for your time :)

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by bricevdm · Dec 24, 2009 at 04:40 PM

EDIT:

It seems this bug only occurs in unity iPhone 1.5.1f2, I installed Unity 2.6 on the same machine and suddenly the triangle count shows up properly in the editor (it matches my 3d ap). A similar problem as this one: answers.unity3d.com/questions/1949/combine-fixed-function-error.

Can we only pray for a quick merge with the 2.x editor?

feedback.unity3d.com/pages/15793-unity-iphone/suggestions/163944-editor-upgrade-to-2-5-unity-editor

======================================================

Hello everyone, thanks for your interest :)

I submitted a Collada file using the bug report, here's the reference: http://intra.unity3d.com/fogbugz/default.asp?309907_288d81br , but I can't see the linked file: just in case www.mentalwarp.com/~transfert/CUBE.dae

If this is some real rendering bug and not some polygon counter issue (seems like it because error is consistent between iphone and editor), it would be more than awesome to spit ~30% more triangle hehe.

@Jessy I'm glad to ear this is not a 3d package related issue, yay

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

Answer by Lucas Meijer 1 · Dec 21, 2009 at 04:31 PM

==Removed incorrect answer after the OP and rune made sense in the comments==

This looks like a bug, if you could be so kind to send us the maya file in question (unitymenu->help->report a bug), we can take a look at what's acting up here.

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 bricevdm · Dec 21, 2009 at 05:06 PM 0
Share

Hi there :) I was expecting this answer but I'm a pro 3d artist so I learned not to make that mistake. We're not talking 36 vertices here, but triangles. Whatever how the cube is split the TRIANGLE count shouldn't increase that dramatically. The vertex count reads 24 in unity (because triangles are paired into quads), which is consistent with maya uv count. So the stripping there is working since this is not 36 vertices as if every triangles was split.

The triangle count is the issue, vertex count makes sense. Anyway witch one should be considered for performance? I guess vertex would

avatar image runevision ♦♦ · Dec 22, 2009 at 10:48 AM 0
Share

Brice is right; this does not explain a triangle count of 32 for a simple box as far as I can see.

avatar image Lucas Meijer 1 ♦♦ · Dec 23, 2009 at 09:44 PM 0
Share

$$anonymous$$ea culpa. This looks wrong. Could you please send us the maya file in question (unity menu->help->report a problem) so we can take a look at what's going on here? Thanks.

avatar image Jessy · Dec 23, 2009 at 11:15 PM 0
Share

I've always seen this with Blender's cube. Same exact stats. I didn't realize it was such a big deal, because non-cube things seem to be fine.

avatar image
0

Answer by VCCGeek · Dec 24, 2009 at 06:53 PM

Quick note if you're using Maya.

Make sure that you delete history on all meshes before you import. I've noticed that if a mesh has a lot of history attached, the mesh will be imported DOUBLE in Unity. The only exception is with skinning -- skinning should be fine. If you are doing a character model that is going to be skinned, make sure to delete history BEFORE skinning it. Not sure this is what's causing your issue, but I know it's bugged me quite a lot.

Edit->Delete by type->History

Hope this helps!

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 Charles Hinshaw · Dec 28, 2009 at 04:14 PM

This isn't an import bug -- 32 polygons is probably correct for a cube unless the cube has been specifically designed to be made of one strip. Triangles need to be contiguous in both 3D and UV space to form a strip. Degenerate triangles (zero area) have to be made to form strips, which accounts for the additional triangles. More than one degenerate triangle is required to connect two separate triangles into a single strip. It is necessary to combine strips so that calls can be limited.

I copied the following from an email where ReJ discussed the issue with why two separate triangles have 7 faces. He explains it better than I can:

Given two separate triangles (1st with vertices 1,2,3 and 2nd with vertices 4,5,6) then strip would look like this: 1, 2, 3, 3, 3, 4, 4, 5, 6 (9 indices in total)

For tristrips Unity uses following formula to convert index count to face count: face_count = index_count - 2. Therefore 7 faces.

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 Charles Hinshaw · Dec 29, 2009 at 02:11 PM 0
Share

The use of triangle strips is an optimization. A cube is sort of a bad example, because it seems like there should be so few polygons - until you take into account that degenerate triangles need to be created to connect polygons that aren't connected in UV space. A cube isn't representative of most meshes found in games - usually there are many triangles that are adjacent to one another. This isn't anything to be concerned with - hardware generally skips over degenerate triangles very fast. And, in exchange, you save a bunch of calls to OpenGL - which are pretty expensive.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Dynamically choosing a high resolution texture at runtime on iOS devices 1 Answer

shadow on plane for iphone 3 Answers

HELP!! OnCollisionEnter is not working when i built it out on IPHONE! 0 Answers

how to load ogg files from documents folder. 1 Answer

smooth transitions for Rigibodies objects on iPhone and iPad 1 Answer


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