- Home /
Trouble in GL lines - change color
Good afternoon. Help please, I have the following problem. I draw an object trajectory by means of GL in a camera script as onPostRender. At a trajectory the fixed color which the user can change in settings. At check in UnityEditor everything is normal. Further I import the project to Eclipse and I appoint to it the minimum API level for Android 2.2. Then I rebuild the project and hollow apk which I transfer to the device with android 2.3.3. There everything works perfectly, but I begin with a certain approach to object color of lines of a trajectory changes on black though it has to be green by default. Prompt that this such occurs and whether it is possible to get rid of it. Thanks in advance for the help. Function in object
public void drawTr() {
mat.SetPass(0);
GL.Begin(GL.LINES);
GL.Color(Color.green);
...
GL.End();
}
Function in camera script in C#
void onPostRender() {
GameObject.Find("MyObject").getComponent<ScriptMyObject>().drawTr();
}
Answer by zharik86 · Dec 17, 2013 at 02:15 PM
I found solution. In new shader create properties of color via
Properties { _Color (\"Main Color\", Color) = ("+color.r+","+color.g+","+color.b+","+color.a+")
THAT' s work in android, but if change color - new shader
Your answer
Follow this Question
Related Questions
GL.LINES cannot switch colors 1 Answer
Material doesn't have a color property '_Color' 4 Answers
Changing two different objects renderer colour 1 Answer
GL.Color() has no effect on android 1 Answer
How do I change GL LINES color? 1 Answer