- Home /
SetTexture combine mode QUAD modifer works different on iPhone/iPad
According to ShaderLab:Texturing document, there are some modifiers available on combining.(such as DOUBLE and QUAD) I have been writing little shader for iOS devices and found out that DOUBLE modifier and QUAD modifier does the same when they work as expected on my Mac. Is this an expected behavior(limitation) on iOS devices, or am I missing something here?
Shader code around texture
SetTexture [_MyOccTex] {
constantColor [_MyLORatio]
}
SetTexture [_MainTex] {
combine texture * previous QUAD, texture
}
Result:
Mac
iPhone4
Answer by Jessy · Apr 07, 2011 at 02:53 PM
It's a bug, but only under fixed function emulation in OpenGL ES 2.0. As such, you can get around it with a programmable shader, or by using OpenGL ES 1.1.
If you need me to write you a GLSL version, then please post the full shader. (What you have above is certainly not what you want, because you're not using _MyOccTex at all.)
I just ran into this issue on iOS.
If you get a chance Jessy, I wouldn't $$anonymous$$d seeing this shader in GLSL:
Shader "Custom/UnlitColor" {
Properties {
_Color ("$$anonymous$$ain Color", Color) = (.5,.5,.5,1)
_$$anonymous$$ainTex ("Base (RGB)", 2D) = "white" {}
}
Category {
Lighting Off
ZWrite On
Cull Back
SubShader {
Pass {
SetTexture [_$$anonymous$$ainTex] {
constantColor [_Color]
Combine texture * constant QUAD, texture
}
}
}
}
}