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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
1
Question by Jessy · Jan 24, 2011 at 03:05 PM · shaderiosiphoneblendingcustom-shader

What shader blending modes don't work on iOS?

There are 100 different blending combinations for RGB, according to the ShaderLab documentation on blending. That is, there are ten "properties" to multiply both the pixel that is currently being renderered, and the one that is in the color buffer, by. On top of that, there is an undocumented ability to blend only the alpha channel result, like so:

// no RGB blending, multiply the alpha channels together
Blend One Zero, Zero SrcAlpha 
// should be the same, because only the alpha component is blended
Blend One Zero, DstColor Zero

In my experience, they all work in the Editor, under any emulation setting. However, some of them can yield incorrect results on iOS devices. Which ones don't work, and why?

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
3
Best Answer Wiki

Answer by Jessy · Jan 24, 2011 at 03:05 PM

MBXlite only

Multiplying a color by itself, or its inverse, results in the blending operation being cancelled. For example, each of these will result in no blending:

Blend SrcColor SrcColor
Blend SrcColor DstColor
Blend Zero DstColor
Blend OneMinusSrcColor OneMinusDstColor 

...while these will behave properly:

Blend Zero SrcColor
Blend DstColor SrcColor
Blend DstColor One
Blend OneMinusDstColor OneMinusSrcColor

MBXlite and SGX

If you don't change the default frame buffer setting (RGB565), then you can't utilize alpha from previously rendered materials. DstAlpha will always be treated as 1, and OneMinusDstAlpha as 0. You can change this by selecting "Use 32-bit Display Buffer under" the "Resolution and Presentation" section of Player Settings.

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 PAHeartBeat · Nov 24, 2012 at 01:36 PM 0
Share

thanks Jessy it's also works for me, i faced issue of DstAlpha count as 1 every time on iOS

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

1 Person is following this question.

avatar image

Related Questions

Problem with texture blending and vertex color shader for iOS 1 Answer

Support for dynamic shadows on newer iOS devices (supporting OpenGL ES 2.0) 1 Answer

"Queue"="Transparent" not working (on iOS). 1 Answer

Toon Shader for the iPhone 1 Answer

What, exactly, in a shader, stops batching from happening? 2 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