- Home /
I have two very simple shaders that are breaking on IOS. Does anybody know why?
I have made two shaders based on the Unlit Unity shader. One provides transparency and the other renders the mesh from the bottom up. These are the errors: WARNING: Shader Unsupported: 'Custom/Unlit_Color' - Pass '' has no vertex shader WARNING: Shader Unsupported: 'Custom/Unlit_Color' - Setting to default shader. WARNING: Shader Unsupported: 'Custom/Unlit_Texture' - Pass '' has no vertex shader WARNING: Shader Unsupported: 'Custom/Unlit_Texture' - Setting to default shader.
Here's the code for one of them:
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_ProgressY("ProgressY", float) = 1.0
_ProgressBuffer("BufferSize", float) = 0.1
_ProgressColor("ProgressColor", Color) = (1,1,1,1)
}
SubShader
{
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Opaque" }
LOD 100
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
fixed4 worldPos : float4;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float _ProgressY;
float _ProgressBuffer;
fixed4 _ProgressColor;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
o.worldPos = mul(_Object2World, v.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float maxY = _ProgressY + _ProgressBuffer;
if(i.worldPos.y > maxY)
discard;
float cVal = 1/(1+exp((i.worldPos.y - _ProgressY)*100));
fixed4 col = cVal * tex2D(_MainTex, i.uv) + (1-cVal)*_ProgressColor;
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
Forgot to note that the two work perfectly on the Editor.
Your answer
Follow this Question
Related Questions
Multiple tex2D commands in fragment shader needed, is there a workaround? 0 Answers
Specular bug on iOS/Android using Standard shader 2 Answers
Set default number/emails in a new text message/email sent via unity 0 Answers
Random shader bug (IOS/IOS Simulator) 0 Answers
grayscale shader on iOS turns black 1 Answer