x


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.

more ▼

asked Jun 24 '12 at 04:40 AM

TheDavil86 gravatar image

TheDavil86
38 3 5 6

(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

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 ?

more ▼

answered Jun 24 '12 at 05:13 AM

Berenger gravatar image

Berenger
11.2k 12 19 54

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?

Jun 24 '12 at 05:34 AM TheDavil86

That's a var you need to declare (and rename, myColor is quite general).

Jun 25 '12 at 02:33 AM Berenger
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x169
x19
x1

asked: Jun 24 '12 at 04:40 AM

Seen: 916 times

Last Updated: Jun 25 '12 at 02:33 AM