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 marpione · Jan 02, 2018 at 03:25 PM · shader programmingperformance optimizationbatchinginstancingmaterialpropertyblock

Performance concerns about using too many materials in one scene

So I have a project where I will look orginise too many object. Those objects are similar to eachoter but different meshes and textures.

Imagine a supermarket where you have bunch of snaks. When you take a general look they all have the same shape more or less. You need to see them all the time and they are not static you can pick them up look an put it back.

So that raises a problem in my head. How can I reuse most of my materials by only changing it's textures.

I'm not a graphics programmer so for give me if I say something noob.

Here is what I tought. Enable Material instancing. I know that enabling material instancing is good if I have multible copies of same mesh and same material but in my case my meshes are slightly different and materials have different textures.

Dynamic Batching. I know I can batch dynamic objects but there are too many limitations. My models are lower then 900 verts but I haven't decided on a shader yet. I'm thinking about Uber shader but dynamic batching limits me interms of shader choice and vertex coun't I'm not sure using standart or Uber shader would force me to lower my vert couse I can't go lower poly than I already am.

The last but not the least is the 2DTextureArray and MaterialProperityBlock. I think this is the best way to go in my stuation but there aren't so many tuts or documantation about it. As far as I understand it's easy to use in c# but I'm afraid if I crash a wall while using this I may not be understand what's wrong since there aren't much reasources out there that explains how this method works.

I want to know what you are thinking what would you do if you had the same stuation.

Cheers! :)

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
0

Answer by OneCept-Games · Jan 02, 2018 at 03:31 PM

You shouldn't have any performance issue on the amount of materials, but more the number of different meshes with about 900 verts each. Have you tried running the Profiler to see what is actually dropping your frame rate? If the performance issue is about to many high poly meshes, then you whould consider making your object more simple models (low poly).

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 marpione · Jan 03, 2018 at 09:09 AM

Actually I haven't started this project. There is a similar project and I need to write a newer version of it. I was told that they will have so many materials and meshes but all meshes are well optimized. However as the number of materials increased and I'm expected to change them on runtime it will eat some gpu memory. Because I'm gonna have to create virtual materials and assign them at run time. What I want to decide at this point how should I start building the project interms of runtime material changes.

Here is an example of what I want to do. Exept this guy changes a single material for the same mesh. My meshes are similar but not the exect same.

http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/

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 OneCept-Games · Jan 03, 2018 at 11:53 AM 0
Share

Then I have no idea of what model to use, rather that trying to set up a Sandbox with different meshes and do performance $$anonymous$$PI's what is the best solution. Sorry, you may repost this Q to get a better answer,

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

74 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

Related Questions

Sprite Batching / Sprite Materia 0 Answers

Multiple Meshes VS Armature 1 Answer

How to Use DrawMeshInstancedIndirect with new Render Pipeline (LDRP or HDRP) 0 Answers

Batching runtime instanced Objects 0 Answers

Texture Atlas in Vert Shader 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