x


Adjust a Material's Shininess Through Script in Realtime

Adjust a Material's Shininess Through Script in Realtime. Can it be done?

more ▼

asked Jul 14 '10 at 12:21 PM

yeoldesnake 1 gravatar image

yeoldesnake 1
549 15 18 22

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

1 answer: sort voted first

You can use something like this:

yourMaterial.SetFloat("_Shininess", shininessFloatValue);

Where yourMaterial is a reference to your material

more ▼

answered Jul 14 '10 at 12:44 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 252

yourMaterial i put there the name of material or like var yourMaterial:material;

Jul 14 '10 at 03:06 PM yeoldesnake 1

renderer.material would work

Jul 14 '10 at 03:10 PM Mike 3

ok , would
yourMaterial.SetFloat("_Height", heightValue); work , changing the bumpmap height?

Jul 14 '10 at 03:41 PM yeoldesnake 1

should do, assuming that's the variable name in the shader

Jul 14 '10 at 06:30 PM Mike 3

well thats what i was asking , if it was the variable name in the shader

Jul 15 '10 at 09:20 AM yeoldesnake 1
(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:

x3314
x807
x57

asked: Jul 14 '10 at 12:21 PM

Seen: 1416 times

Last Updated: Jul 14 '10 at 12:21 PM