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
1
Question by wojwen · Aug 01, 2016 at 07:08 PM · textureperformancematerialsmeshrendererlow poly

Is it better to use multiple materials or bake texture on low poly assets?

I'm creating low poly assets for my game in blender. They are pretty simple, I just assign different colors to different faces (e.g. in tree leaves are green and trunk is brow). Before I just imported the to unity, but now I'm wondering if it's better(in case of performance) to bake texture and assign it to the object? Or maybe I should split the object to different meshes in blender and assign one material per mesh?

Comment
Add comment · Show 2
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 vintar · Aug 01, 2016 at 08:28 PM 0
Share

One material per mesh will always be heavier.

avatar image wojwen vintar · Aug 01, 2016 at 08:56 PM 0
Share

So the best option is to bake texture or use multiple materials?

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Devastus · Aug 02, 2016 at 01:19 AM

Less unique meshes, less unique materials = less drawcalls. Less drawcalls = very likely better performance (in some rather rare cases this might not be true however).

Textures get stored in memory. Drawcalls use CPU.

So, strictly performance-wise, your best bet would be to have multiple objects using the same single material with the texture being a texture atlas that contains the textures for all the different objects inside one image. Your objects will be UV mapped into their corresponding places on the atlas, and thus you'll have just one drawcall (the other meshes will be batched) instead of a dozen, and dramatically reduced CPU load.

Since that may be more work than you require for results, I recommend you to atleast bake the texture for the mesh instead of using several materials to produce the same effect.

Comment
Add comment · Show 2 · 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 wojwen · Aug 02, 2016 at 11:03 AM 0
Share

Thanks! That's exactly what i read about and I wasn't sure if it's a good method. So if I'm using only one color per face I can create for example 8x8 pixels texture(each pixel with different color) and map UVs on the correct color? Another thing is that drawcalls are now split to batches nad SetPass calls. I still have problem with understanding this, but to simplify: if this method works correctly which of these should stay on the same level?

avatar image Devastus wojwen · Aug 02, 2016 at 09:31 PM 0
Share

Yes, you should be able to UV map them on their correct colors. Note that if you intend to do lightmapping of any sort, you'll have to make a separate Lightmap UV for each object as otherwise an 8x8 texture that has the UVs sorted in an atlas shape will more than likely produce severe artifacts.

In best scenario, you should see a positive reduction in both Setpass calls and batches. Now, my understanding may be invalid, but if I am correct, SetPass calls are the actual passes in shaders called to be rendered. Shaders can have multiple passes, and each post-effect will produce at least one SetPass call. Batches are the actual geometry and materials being grouped and sent to the GPU to be drawn, ie. grouped Drawcalls (someone correct me on this if I'm wrong).

Generally speaking, reducing the number of unique materials (and unique meshes using them) and the amount of passes in your shaders will result in better performance. The importance of doing intrinsic optimizations on these matters depends a lot on your platform of choice, and while I'm still a fan of good optimization, PC games for example can handle the absence of texture atlasing and other techniques to a greater extent. There's power in being able to modify your content later on, which often times gets cumbersome with heavy optimization applied.

avatar image
0

Answer by Trevdevs · Aug 01, 2016 at 11:39 PM

I'm doing the same thing your doing, making a game with low poly models, what I've been doing is adding the materials in the modeling software such as blender which I'm using that way when it gets exported the materials are also exported automatically. So I would say multiple materials. Although it shouldn't make much of a difference which you use i Just find mine to be simpler.

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Effects Of Tiling Textures 1 Answer

Mesh renderer with three submesh textures - only one renders properly, others are solid colors 1 Answer

Performance: many materials vs. TextureMap 2 Answers

How to fix a half transparent texture? 1 Answer

Can't copy skybox faces to a cubemap sized texture without huge quality loss 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