Thanks for looking into my case! I need all of the sprites in the container to have the same brightness level.
I am clearly missing something here. I have made a script like you suggested and added it to:
1) One of the sprites: no effect
2) Panel=container of the sprites: no effect
3) UIAtlas with the material: no effect
As for the script, it's this simple:
using UnityEngine;
using System.Collections;
public class ChangeBrighnessShader : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnRender (Material mat)
{
Debug.Log ("render!");
mat.SetFloat ("_Brightness", 20.0f);
}
}
The shader works for sure. I also tried "Brightness" instead of "_Brightness", also no effect. Anyway the DEBUG message is never displayed, so I assume somehow this onRender stuff never happens?

By the way, I also tried this
Object [] renderers
= GameObject
.FindObjectsOfType(typeof(Renderer
)); int i_max = renderers.Length;
for (int i = 0; i < i_max; i++)
{
Material[] materials = ((Renderer)renderers[i]).materials;
int j_max = materials.Length;
for (int j = 0; j < j_max; j++)
{
if (materials[i].shader.name == "Unlit/Transparent Colored (Bright)")
{
Debug.Log ("shader found!");
materials[i].SetFloat("Brightness", 2.0f);
}
}
}
This code says "shader found", but the brightness is not adjusted
