Self-Illuminating Shader question

I am trying to create GUI controls that glow with oscillating intensity. I have been messing around the the self-illuminating shader, trying to get a feel for how it works. I can get it to ‘glow’ (illuminate itself), but I can’t seem to vary the intensity. I’d like it to cycle from a flat, diffuse color to a brighter version of that color, and back again. Am I not using the correct approach?

Also, I am using Indie version, so post-processing is not an option.

You could use something like this to saturate and desaturate the texture and see how that looks.

Maybe vary the _Specular …

Maybe add particles from it (if that’s possible) …

renderer.material.SetColor("_Color", new Color(1, 1, 1, val));

My experience with self-illuminating textures is that the material.color properties contributes a fair degree to the final output… So for example if you do your interface in all black and white textures, then the white will essentially take on whatever color you set in that property. So if you wanted to pulse from bright to dull red, say, you could try something like this in an update loop:

renderer.material.color=Color(.9+.1*Mathf.Sin(Time.time),.2-.2*Mathf.Sin(Time.time*freq),.2-.2*Mathf.Sin(Time.time*freq))

That ought to oscillate the color between pure red-- that is, Color(1,0,0)-- and a more muted red of Color(.8,.4,.4).

I can’t speak to the efficiency of this approach, but if you aren’t doing it for a lot of objects it’s probably not the end of the world.

Er… I guess you’d want it to be Time.time*Mathf.PI*freq if you wanted those frequencies to be intuitive. Then your frequency is in hertz.