- Home /
Question by
spiceboy9994 · Oct 01, 2013 at 02:53 PM ·
shaderipadvertexshader
Vertex Shader is Opaque on iPad and iPadMini
Hi:
I have an issue with my Shader, I created this shader to make it work with the Decal System Pro Vertex color and animate this vertex color so I can do a decal to be animated as burnmark, so this shader allows to animate the glow image (which is a red one) to the main one, which is the burnmark. This works perfectly on the editor or even iPhone 4s and 5. But within my build on iPad Mini and iPad 2, the shader looks different. It looses the glow (or the light) on the iPad Devices... it looks opaque. Do you know what the problem could be?. I created this shader based on the Decal / Colored / Transparent Diffuse Colored one that is packed within the decal system pro Package. I would appreciate any advice on this one.
Shader "Custom/VertexColorGlow" {
Properties
{
_DiffuseTransp("_DiffuseTransp", 2D) = "gray" {}
_Glow("_Glow", 2D) = "black" {}
_MainColor("_MainColor", Color) = (1,1,1,1)
_VColor("_VColor", Color) = (1,1,1,1)
}
SubShader
{
Tags
{
"Queue"="Transparent+2"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Offset -1, -1
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _DiffuseTransp;
sampler2D _Glow;
float4 _VColor;
float4 _MainColor;
struct Input {
float2 uv_DiffuseTransp;
float2 uv_Glow;
float4 color : COLOR;
};
void surf (Input IN, inout SurfaceOutput o) {
o.Normal = float3(0.0,0.0,1.0);
o.Alpha = 1.0;
o.Albedo = 0.0;
o.Emission = 0.0;
o.Gloss = 0.0;
o.Specular = 0.0;
float4 Tex2D0=tex2D(_DiffuseTransp,(IN.uv_DiffuseTransp.xyxy).xy) * _MainColor;
float4 Tex2D1=tex2D(_Glow,(IN.uv_Glow.xyxy).xy);
float4 Multiply0=Tex2D1 * _VColor * IN.color;
float4 Master0_1_NoInput = float4(0,0,1,1);
float4 Master0_3_NoInput = float4(0,0,0,0);
float4 Master0_4_NoInput = float4(0,0,0,0);
float4 Master0_7_NoInput = float4(0,0,0,0);
float4 Master0_6_NoInput = float4(1,1,1,1);
o.Albedo = Tex2D0;
o.Emission = Multiply0;
o.Alpha = Tex2D0.aaaa;
o.Normal = normalize(o.Normal);
}
ENDCG
Pass {
ColorMaterial AmbientAndDiffuse
Fog { Mode Off }
Lighting On
SeparateSpecular On
SetTexture [_Glow] {
Combine texture * primary, texture * primary
}
SetTexture [_Glow] {
constantColor [_VColor]
Combine previous * constant DOUBLE, previous * constant
}
}
}
}
Comment