- Home /
Changing the Tint Color of Material To Change V
Ok so what I'm trying to do is change the brightness of a material by changing it's "V" value in the Tint Color property. Not sure where to go from there though. This what I've got so far:
// The Material to change
var SkyboxMaterial : Material;
function Start () {
// Set the initial tint
SkyboxMaterial.shader.GetComponent("TintColor");
}
I'm trying to do this so I can Mathf.SmoothDamp my skybox from black to the blue color that it normally is. Any help would be appreciated.
Answer by Berenger · Jun 24, 2012 at 05:13 AM
You need to use
SkyboxMaterial.SetCOlor( "_Tint", myColor );
to change the color. Not sure what you mean by V value. The V of a HSV color ?
Thanks, yes I mean the HSV color portion. Is myColor a constant of some kind or is that a variable I make up? And what type of variable should it be?
That's a var you need to declare (and rename, myColor is quite general).
Answer by Nilsboom · Apr 11, 2015 at 03:16 PM
Here is the solution - RenderSettings.skybox.SetColor( "_Tint",new Color(56.0f/255.0f, 32.0f / 255.0f, 14.0f/255f,128.0f/255.0f));