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 /
avatar image
0
Question by LeeGibson · Sep 14, 2011 at 10:45 AM · texturemeshoptimizationworkflow

optimizing mesh & textures

hello there,

this is more of a general question. i'm in the process of optimizing my game and it seems that i need to reimport my meshes because i misunderstood some guidelines. so, before i start all the work of combining and wrapping my models i'd like to be sure that i'm doing it right this time ~_^

i have one center platform leading to four platforms with a small hut on each. since i read about combining i combined everything in close proximity to each other (i.e. on each platform) in packages of about 3000 verts and gave each of those packages its on texture/material. since i didn't plan it right from the start, i added a lot of small objects in each of the huts, again each with its own material. when i start the game on a computer without proper gpu i end up with 5 fps, which is really quite frustrating.

now i read in the documentation that it's not advised to combine the meshes in a 3d application (which i unfortunately did). does that mean that i should really combine nothing at all? i have lots of wooden boards, railways, ropes, small stuff, do i just leave it as single meshes and import everything into unity?

and how would i go about combining all of it in unity? i plan on wrapping the texture of all static objects into one texture atlas, but since 4k is the limit on textures i'm not sure if that is enough. should i put the texture of dynamic/moving objects into the texture atlas as well? does it even make a difference if they're dynamic? and: do i use as much texture atlases as i can or is there a case when it might be better to use a single material?

i would be grateful if any of you could share how you do it - how do you plan your meshes and textures, what is your workflow? thanks!

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

Answer by syclamoth · Sep 14, 2011 at 11:01 AM

I had a similar problem recently, where I built all of my buildings out of modular segments in maya which could be assembled when they were brought into Unity. The problem was, that when I ran it the game went down to about 15 fps, and was virtually unplayable (although, I admit, not as bad as yours). My solution was twofold- I first attached a script to all the buildings which (when the level was loaded) iteratively searched through every single mesh renderer in every building and combined every mesh that used a shared material using Mesh.CombineMeshes to create a much smaller number of objects (thus reducing draw calls). Because I did this once for each building, every building got combined into a set of 8 or so huge meshes which interlocked (one for walls, one for cornices, one for windows etc).

The second part of the solution was to put a script on each one of these joined meshes which automatically set the shader to the default VertexLit if the object was a certain distance away from the camera (which was polled randomly every 0.5-1.5 seconds so as not to have a huge performance hit), making rendering significantly less expensive for less relevant meshes.

When it was all set and done, I got performance increases of between 100 and 150%- not great when you consider what I was improving from, but still better than what I was getting before.

An interesting thing to note is that I later purchase Unity Pro- and it immediately made my scene populate 4 gig of memory and then crash whenever I ran it! I discovered that this was because of unity's static batching conflicting with my combiner script- meaning that the objects were being combined automatically during export, and then copied about 100 times and combined AGAIN by mine! I turned off my custom script, and discovered (to my horror) that the Unity static batching actually didn't do as good a job (because it had to be more generalised).

In the end, I had to scrap that level, but I learned some important lessons- mainly to keep your environmental meshes as simple as possible, and to try to reuse textures as much as you can. There are a lot of creative ways you can make the same texture look different- by using different parts of it in different ways, or by rotating and scaling it. In the end, for small static objects, I would say that a texture atlas would have to be the way to go, assuming that you then combine all the objects into a single mesh at runtime.

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 LeeGibson · Sep 16, 2011 at 08:37 AM 0
Share

thank you very much for your detailed answer! i'm very grateful for the experience of other people - there are a lot of tutorials, but i didn't find any that focus on the general workflow.

i tried to optimize the performance with lightmapping, but strangely it made the fps even worse. maybe i just didn't do it right ;)

i'll rework the models now so that the buildings share one texture and all the small objects share another one and then let unity do the batching - i'm using the Pro Version of Unity, so i hope it works.

thanks again, i'll be sure to post if i come to any interesting conclusions!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Can anyone identify this texture/mesh quality problem? 2 Answers

Efficient mesh vertex count changes? 1 Answer

Do I need to split my mesh up to properly UV texture it? 1 Answer

Unity ASTC Texture Format 0 Answers

Repeat Texture instead of Stretching it all over? 4 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