- Home /
shader_feature in "multiple shader program variants" doesn't work on Android
I am trying to use the shader_feature
in this doc. Everything works fine on desktop in editor, but when I push it to Android device, it doesn't work, without any error log.
Is this a limitation for this feature? or I'm doing something wrong?
Here is my simple test:
Shader "Tango/YUV2RGB" {
SubShader
{
ZWrite Off
ZTest Off
Tags { "Queue" = "Background" }
Pass
{
GLSLPROGRAM
#ifdef VERTEX
void main()
{
gl_Position = gl_Vertex;
}
#endif
#ifdef FRAGMENT
#pragma shader_feature DISTORTION_ON
void main()
{
#ifdef DISTORTION_ON
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
return;
#endif
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
#endif
ENDGLSL
}
}
}
Comment
Your answer
Follow this Question
Related Questions
GLSL: unsupported array parameter 'unity_LightPosition' (and 'unity_LightColor') 1 Answer
Vertex Shader and Non-uniformly scaled meshes 1 Answer
Please suggest Car Paint shaders compatible with Unity 1 Answer
Shader Fails to Compile on iOS: GL_EXT_frag_depth 2 Answers
Combine Basic Shadow Shader and Transparency Shader in Unity 0 Answers