- Home /
This post has been wikified, any user with enough reputation can edit it.
Manipulating transparency with mobile shader (particle/VertexLit Blended) works on computer, but not on device
Basically I have a background plane of "stars" that should fade as the player gets near to a planet. Here's the relevant code as it is now:
GameObject starFieldObj = GameObject.FindGameObjectWithTag ("Starfield");
Mesh mesh = starFieldObj.GetComponent <MeshFilter> ().mesh;
Color [] starField = mesh.colors;
void SetStarfieldAlpha ()
{
// The alpha we will eventually set the starField to
float totAlph = 1.0f;
// For each planet of this controller...
for (int i = 0; i < planets.Length; i++)
{
// If the alpha for this planet is less that the previous smallest alpha...
if (planets [i].ReturnStarfieldAlph () < totAlph)
{
// Make it the new reference alpha
totAlph = planets [i].ReturnStarfieldAlph ();
}
}
// For each vertex color...
for (var i = 0; i < starField.Length ; i++)
{
// Set the new opacity
starField [i] = new Color (starField [i].r, starField [i].g, starField [i].b, totAlph);
}
// Set the new color for the mesh
mesh.colors = starField;
}
It works perfectly as intended on my computer, but when I build it on an actual device (in this case an iPad 2) the starField doesn't fade at all. Anyone know what I'm doing wrong?
Comment
Your answer

Follow this Question
Related Questions
See through issue in iOs 0 Answers
Problem with transparent shader on iOS 0 Answers
how to build impressive shaders for iOS? 1 Answer
Standard shader strange reflection artefacts 0 Answers
Different Shader Display on 3gs vs. 4s 2 Answers