- Home /
Graphics.DrawTexture with Shader not working on iOS?
I am trying to quickly finish a demo so that it can be presented however I am currently struggling with the drawing of a very simple shader via Graphics.DrawTexture.
The code works on both Windows & Mac Editor, however once loaded on iOS, the texture simply appear black. I attempted remove the moving effect, the coloring, removing parameters, increasing the texture size but nothing works.
Here's an exemple of a really simple shader that should have worked :
Shader "Custom/MovingVertexLit" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Color ("Main Color", COLOR) = (1,1,1,1)
}
SubShader {
Tags { "RenderType"="Overlay" }
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
float4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
fixed4 output = tex2D(_MainTex, IN.uv_MainTex += 0.5 * _Time);
o.Albedo = output.rgb * _Color;
o.Alpha = output.a;
}
ENDCG
}
FallBack "Diffuse"
}
-OpenGL ES 2.0 is being used.
-Display buffer is already set to 32-bit.
I am really out of idea and I have no clue why a simple shader drawn on a GUI would be such a problem. Anyone has any idea of what is happening? :(
Answer by ShaZe88 · May 29, 2013 at 04:50 PM
It appear the mobile device does not welcome any shader using surface properly