I’m trying to show a fading splash screen, So I setted up a strecthed cube in front of the camera(as explained in the guide). Now I want to fade out that cube changin vertices alpha values. The code for this(script attached to the cube):
void Update () {
float alpha = Mathf.Sin (Time.time);
Mesh myMesh = GetComponent<MeshFilter>().mesh;
if(myMesh){
Debug.Log("transparency changed!");
}else{
Debug.Log("cube not found!");
}
Color[] meshColor = myMesh.colors;
int i;
for(i=0;i<meshColor.Length; i++){
meshColor*.a = alpha;*
-
}*
- }*
seem’s that vertex color is not used at all by any of the material ( I tried all materials and no one showed vertex color):
That’s a big feature lack! fix that! In FREE version of unity there’s no need at all for use “COLORS” component in vertices since no material is using vertex colors => memory waste. Alpha value in vertices will allow for a lot of nice effects even on older fixed-pipeline hardware. Seems a big pity Unity “skipped” that important detail in FREE version.