- Home /
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?
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.
thanks Jessy it's also works for me, i faced issue of DstAlpha count as 1 every time on iOS
Your answer
Follow this Question
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