x


Modifying a shader color dynamicly through another script

Hi,

I'm sure this is really simple, but my brain doesn't seem to process the infos correctly...

I used the HSV_HSB_Colorpicker shader that I found on unity's forum on a cube and a plane. Now, I want to create a script to be able to change there hue ingame, or dynamicly through music.

What can I do ?

more ▼

asked Nov 21 '10 at 09:48 PM

Goji gravatar image

Goji
1 2 2 2

renderer.material.SetColor("PropertyName", Color). or renderer.material.color will set the "_Color" property.

Nov 21 '10 at 10:44 PM Peter G

In that case, it's not the color that I want to change, but a parameter named _HueShift in the shader code.

Nov 21 '10 at 11:03 PM Goji

http://unity3d.com/support/documentation/ScriptReference/Material.html. I haven't seen this shader, but look through that and find the type of parameter you need. My guess would be that it is a float, but you need to find out.

Nov 21 '10 at 11:37 PM Peter G

what colorpicker is the OP referring to? i searched the net for HSV_HSB_Colorpicker and only found this post.

Jul 22 '11 at 09:07 PM vestax_ion
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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:

x3330
x1655
x507
x379
x32

asked: Nov 21 '10 at 09:48 PM

Seen: 3707 times

Last Updated: Jul 22 '11 at 09:07 PM