x


Is it possiable to change the Emissive Color on VertexLit Blended Material with a script?

I'm using java and have been at this for hours and it should be as simple as the below code but it doesn't work. I can get the other materials to work, but not the VertexLit Blended Material.

Is this even possible? I'm begging to think it's not, which would be a let down as it looks so good for the script I'm writing..

Is there another way to do this? I have looked through all the documentation. I have tried both function start and update. I also have @script ExecuteInEditMode() so that everything it in real time.

renderer.Material.SetColor ("_Emission", globalFogColor);
more ▼

asked Feb 29 '12 at 06:12 AM

BHS gravatar image

BHS
206 26 45 53

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

1 answer: sort voted first

Despite what the docs say about "_Emission" being the name of the emissive property of a shader, the name is actually defined in the shader itself and can be something else. If you download the source for the built-in shaders and look at the Particle VertexLit Blended shader, you can see that the property is actually called "_EmisColor" there, and using that with renderer.Material.SetColor should work.

more ▼

answered Mar 13 '12 at 05:47 AM

Radazen gravatar image

Radazen
21

Saved my life with your answer! Thanks! I'd +1 it, but the website won't let me :P

Oct 05 '12 at 01:49 AM RFLG
(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:

x811
x506
x379
x13
x10

asked: Feb 29 '12 at 06:12 AM

Seen: 1189 times

Last Updated: Oct 05 '12 at 01:49 AM