Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Covenant · Aug 26, 2015 at 06:14 PM · spritebatchingsetpass

Sprites: Too many setpass calls?

Hey folks,

First here's a few stat screens to get my point across:

Before -

After -


I'm new to Unity so I don't understand what is happening. I am using Unity's Sprite packer. So there should be a total of 4 drawcalls for all the sprites (body sprite, weapon sprite, healthbar, and shadow blob). All sprites use default sprite material. I was under the impression if sprites use same material and that material is using same texture (in this case should be 4 different textures), then they'll all get batched together? What am i missing?

EDIT: If I put all sprites in same spritepacker and disable blob shadows, the setpass calls stay at around 50-70. As soon as blob shadows are enabled it goes up to the 500+ range again. Why does batching fail when the blob shadows are drawn?

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

Answer by Baste · Aug 26, 2015 at 06:27 PM

Blob shadows are created by projectors. Projectors have this great feature where they add one draw call per other mesh they hit. So even if your sprites are batched, the blob shadows are not. Be sure to have the blob shadows set to only hit the layer you want them to hit - ie. the ground, and nothing else. They might be trying to blob on your sprites for some reason.

Try turning off the blobs one by one, and see what effect each one of them have individually. Also remember that draw calls are not born equal, and the important thing is the end performance, not the draw call number.

If you really want to dig into what each drawcall is, you can check out the frame debugger.

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 Covenant · Aug 26, 2015 at 07:44 PM 0
Share

Ah, thank you! Your explanation on the projectors helped a lot. The ignore layer was the key that I was missing. Now each new "unit" only adds 1 more to setpass calls for the shadow projector ins$$anonymous$$d of 4+. In the end I may ins$$anonymous$$d use a shadow sprite placed under them but for now performance is acceptable.

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

Masked sprite batching 0 Answers

How to instance custom sprite shader? 0 Answers

Sprite batching 1 Answer

Orthographic mode and Z coordinate for 3D meshes? 0 Answers

Sprite batching 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