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 manny003 · Jul 08, 2014 at 08:38 PM · shadermaterialperformance

Are transparent shaders more efficient when they're 100% opaque?

OK, so I know that shaders with transparency costs more to render -- specifically in my case, I have to use the standard Transparent/Specular shader because there's no equivalent under the Mobile selection. And I don't have the knowledge or time to write one.

My question: When the shader is 100% opaque, is it more efficient? In other words, does the shader know when to skip a render pass if it doesn't need it?

The transparent effect I'm using is not during a performance critical part of the game so I'm hoping the answer is "Yes" but would like to know for sure.

I know I could probably swap out materials during run-time but would prefer not to if it can be avoided.

Thanks, Manny

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
0

Answer by tswalk · Jul 08, 2014 at 09:17 PM

Q: When the shader is 100% opaque, is it more efficient?

depending on the shader, more likely not. You could perhaps customize a shader to do branching, but on simple things branching is even less efficient (depending on how complex you need the shader to be).

As for 'render pass' is concerned, you need to think of it more in the sense of per pixel passes. You can make a shader with multiple passes, and the glass like shaders I've seen do.. but you don't necessarily need to do this for a simple alpha blend.

You could easily make a single pass, forward base render shader that uses blend "SrcAlpha OneMinusSrcAlpha" to get very basic and efficient transparent shader.

I would say, that in your case, using the unity provided shader may be sufficient, but the only way to know is to test it. Use it in a complex scene and see how it works. Otherwise, there's a bunch of low cost shader packages on the asset store, and i'm sure many have mobile ready.. some free, some not.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Shader performance question. 0 Answers

Same texture in different materials performance 2 Answers

Is having many instances of the same material bad for performances? 3 Answers

Material doesn't have a color property '_Color' 4 Answers

Very slow performance when I use scalled quad on a mobile device. 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