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 soxjke · Dec 19, 2012 at 10:36 PM · meshiphoneperformance

Best way of creation custom object

Hello all, i need some help. I have to create an object in from of pendulum spiral. The object must be as much real as possible (high level of detalisaion) and must render fast on mobile device (iPhone 4+). I have now spiral created with custom mesh, not optimized (i dont reuse vertices). The problem is that when i apply some deformation to it (i update vertices coordinates), i get miserable FPS, like 10-12. For now: 1) Do i have to optimize my mesh? (reuse vertices etc.) 2) Or are there other ways to create custom object except of programmatical mesh creating? 3) If they are give me please short understanding about them (fast/slow, easy/hard-to-use) or links.

Thank you for attention and for any help. Sorry for terribad English.

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

Answer by Alec Thilenius · Dec 19, 2012 at 11:13 PM

So it sounds like you have a mesh you want to programmatically deform? Did I understand that correct? Unfortunately it sounds like what you are trying to do will be far too expensive to accomplish on mobile. There are two ways to do per-frame mesh updates. You can do it on the CPU, or on the GPU. If you update your mesh per frame on the CPU then it will be slow, there is no way around it. It’s a VERY expensive operation to iterate over tens of thousands of floats and perform complex math on them given the number FPUs most CPUs have. It’s even more expensive to then reload that updated buffer into graphics memory (Probably more expensive than recomputing it). The second option is to compute everything on the GPU via a computer shader. This is of course not an option for mobile.

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 soxjke · Dec 20, 2012 at 12:13 AM 0
Share

Yeah, i know that floats are killer for AR$$anonymous$$ architecture...With Intel all sounds much better/ But i can't believe that's no way to optimize computations to make some of them on GPU, or optimize buffer reloading into graphics memory etc. There are few games with very expensive graphics like Asphalt 7 or GTA 4 on iOS platform and they work even good. I can't believe that my per-frame updating spiral is too hard for this system... I am actually looking for methods of rendering custom objects except mesh, like LineRenderer component etc. Or some OpenGL hooks?

avatar image Alec Thilenius · Dec 20, 2012 at 12:24 AM 0
Share

Unfortunately what you are asking is a very VERY complicated field. $$anonymous$$aybe I am not understanding what you are trying to do correctly? Assu$$anonymous$$g I am, then there isn’t much of a way around it. It doesn’t matter if its AR$$anonymous$$ architecture, Intel, PowerPC, or A$$anonymous$$D, a CPU will never be good at FPU calculations. A CPU is a SISD Single Instruction Single Data processor. A CPU can only do 1 FPU calculation per tick (Not all entirely true, but I’m not getting into a discussion about OOO execution units, or $$anonymous$$$$anonymous$$X). A GPU is a Single Instruction $$anonymous$$ultiple Data processor, it is VERY good at FPU calculations, but is very limited in what it can do. To run what you are talking about on a GPU requires you write a ‘kernal’ in HLSL and load it on the GPU. This is not possible on mobile because the GPUs are fixed pipeline and are NOT programmable.

avatar image soxjke · Dec 20, 2012 at 12:32 AM 0
Share

I realize what are you talking about... Sure i won't write kernel driver or something else, which is OS hook. I'll optimize mesh update then.. less mesh updates, less mesh size... And now, i think i got how Asphalt or GTA works on iPhone - they both have nondestructive world so no need mesh updates. Thanks, your posts were very useful. I'll keep topic open for a while - maybe someone else gives me some ideas about faster way to make updatable object without programmatical mesh update.

avatar image Bunny83 · Dec 20, 2012 at 01:55 AM 0
Share

Computing floats on modern PC isn't that slow. I was actually suprised to discover that my lookup table for Sin() was slower than $$anonymous$$ath.Sin. Almost the same for $$anonymous$$ath.Sqrt(). The FPUs nowadays are really great. Of course a GPU is optimised for float operations, but only of similar kind. A GPU works way different than a CPU. A GPU is great to perform the same actions on a great set of data. Branches for example are slow as hell on the GPU.

Program$$anonymous$$g the GPU is even much more complicated than using threads wisely.

avatar image Alec Thilenius · Dec 20, 2012 at 02:21 AM 0
Share

@Bunny83 modern ultra high performance CPUs (Like the Intel extremes) are measure in gigaFLOPS (Billions of floating point instructions per second). $$anonymous$$odern graphics cards are measured in TeraFLOPS (Trillions of floating point operations per second). I would not consider 3 orders of magnitude slower than a GPU "not that slow".

avatar image
1

Answer by Bunny83 · Dec 20, 2012 at 01:49 AM

The problem is not the mesh itself. Well it's quite heavy to upload the mesh data into the GPU, but what is by far more expensive is rebuilding a collisionmesh for Physx. I've made this spherify terrain engine for another question here and i had massive lag when updating the MeshCollider mesh. As soon as i removed the collider it works perfectly.

Just to be clear: this sphere is made up by 6 seperate plane meshes with 64x64 vertices (vertices are shared, but that doesn't really matter). It works almost as well on my Nexus7 Android tablet. You can see a little FPS drop when pulling a slider, but not really much.

If you have an android, here's the same thing as APK.

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 soxjke · Dec 20, 2012 at 08:07 AM 0
Share

$$anonymous$$y mesh has now 60000 verts, 20000 tris, and sure, no collider! But it's still slow ... I think, i have to optimize mesh, maybe create set of deformated meshes and then enable correspondong mesh each frame

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

11 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

Related Questions

Vehicle Parts - Bones or Separate Objects? 2 Answers

Skin mesh model merge (iPhone and android) 2 Answers

Big problem: Meshes crash memory from CharacterCustomization example 3 Answers

Combining meshes for independently moving objects 2 Answers

Are big meshes all held in memory? 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