x


How to change color of Particles/additive material ?

Hi,

i know this question was asked several times and theres many topics on this, but i didnt seem to find any answer in those so i will try to ask this again. How do you change color of additive particles shader at run time ? Strangely enough, the regular renderer.material.color = Color.yellow; wont work on this shader. Thanks for any help.

Luke

more ▼

asked Aug 09 '11 at 10:35 AM

oliver344 gravatar image

oliver344
16 11 11 13

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

1 answer: sort voted first

The particles themselves have a color (they use vertex colors, I believe). So you have to change the colors of the particles (see ParticleEmitter.particles array).

Or change the ParticleAnimator.colorAnimation colors.

Or just use a different shader.

more ▼

answered Aug 09 '11 at 11:27 AM

Waz gravatar image

Waz
6.4k 22 33 70

thanks for reply. And how do i acces ParticleAnimator.colorAnimation ? my object doesnt have particle animator so it cannot access it. Its regular prefab with simple geometry and it has this shader on it. I tried to add the particle animator component, it didnt help tho.

Aug 09 '11 at 11:43 AM oliver344

In that case you're left with the final option (use a different shader), sorry. VertexLit transparent with black colour and full emission might do what you need, or modify Particles/Additive.

Aug 09 '11 at 11:46 AM Waz
(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:

x808
x637
x506
x379
x38

asked: Aug 09 '11 at 10:35 AM

Seen: 2196 times

Last Updated: Aug 09 '11 at 11:48 AM