- Home /
GL - Shader not working in Android
Hi,
I'm drawing triangle primitives using GL class. I create the following material:
lineMaterial = new Material( "Shader \"Lines/Colored Blended\" {" + "SubShader { Pass { " + " Blend SrcAlpha OneMinusSrcAlpha " + " ZWrite Off Cull Off Fog { Mode Off } " + " BindChannels {" + " Bind \"vertex\", vertex Bind \"color\", color }" + "} } }" );
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
then I draw in the OnPostRender event:
lineMaterial.SetPass( 0 );
GL.PushMatrix();
GL.Begin( GL.TRIANGLES ); // Triangle
GL.Color(Color(0.4,1,0.4,0.3));
// draw triangles
GL.End();
GL.PopMatrix();
In my PC this is working perfectly. When I build for Android and test it in a Samsung S2 smart phone, triangles are drawn in black color. Do shaders for Android have some restrictions or something?
Answer by gnp89 · Jul 04, 2012 at 05:18 AM
Solved. It was an alpha blending issue.
Source: http://answers.unity3d.com/questions/131195/destination-alpha-blending-on-android-device.html
Your answer
Follow this Question
Related Questions
GL.Color() has no effect on android 1 Answer
Black texture on Android (shader) 0 Answers
Material doesn't have a color property '_Color' 4 Answers
Glass material or shader for mobile? iOS Android 1 Answer
Realistic metalic on mobile 0 Answers