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
1
Question by Jessy · Dec 21, 2009 at 04:05 AM · shadercustom-shader

What's faster? Two draw calls or a black/white alpha blend?

What would be faster? Using the shader I posted here, or using two meshes with this shader?

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 runevision ♦♦ · Dec 21, 2009 at 09:53 AM 0
Share

If this question is about shaders in Unity iPhone, please use the iPhone tag and make it clear from the question that you are talking about iPhone.

avatar image Jessy · Dec 22, 2009 at 08:32 AM 0
Share

It's not. I tested it in Unity iPhone, and gave my results as it pertains to Unity iPhone, but the question itself is not related to batching.

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Jessy · Dec 21, 2009 at 07:14 AM

No, there's no sorting necessary, because this isn't about blending with what's on-screen already.

I did a test tonight after I got home. With 30 visible instances of that eyeball thing from the first link, broken into two pieces (60 draw calls), I got about 33 fps on my iPod touch 2G. With the black/white vertex color blended shader (30 draw calls), I got about 36 fps.

On my iPhone 3GS, it was about 40 versus 41.

So the difference doesn't appear to be great. If you have two meshes that are always going to be visible on screen together, using the black and white "blending" route might be worth doing. Otherwise, probably not.

EDIT: I did two another test with 25 eyeballs, but with duplication of one material per part. Using the blending shader (1 draw call, 25 batched), I got 45 fps. But with two meshes (2 draw calls, 50 batched), I got 46 fps.

Seems like a balancing act that's not really worth bothering with. I think it's probably best to use two meshes, and try to batch the component parts with other things in the scene with similar color.

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
1

Answer by Peter Alexander · Dec 21, 2009 at 04:52 AM

It's hard to say. Alpha blending is typically pretty fast, but then it has to be sorted in order to get semi-correct draw ordering.

I'd guess alpha blending, but the only way you're going to find out is by trying it and seeing what works best.

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

No one has followed this question yet.

Related Questions

How can I pass world position to a custom lighting function for a surface shader? 1 Answer

Strange, triangle shaped holes appearing in my applied shader. 1 Answer

Custom shader dissappear on mobile 0 Answers

making the built in shader Reflective/Diffuse to Fade In Out 1 Answer

What shader blending modes don't work on iOS? 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