x


Changing the alpha of specific vertexes:

How would I go about editing the actual vertexes of a plane? For instance, I'm trying to implement fog-of-war in an RTS game. What I've decided to do after a considerable time spent researching is to make a plane above my units but below my main camera. Then, if a unit walked under it, set the vertices to alpha 0 by using a raycast up from the object to detect where the unit is. However, I don't know how to change the alpha of specific. How would I do that?

Thanks in advance, Elliot Bonneville.

P.S. Thanks for anwering all my many questions, everyone!

more ▼

asked Mar 23 '10 at 11:48 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

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

1 answer: sort voted first

You would need to make use of the Mesh class, in particular Mesh.colors for vertex colors. Also you'd need a shader that actually uses vertex color of course. Most of the built-in ones don't, but the particle shaders do, and there are some on the wiki as well.

more ▼

answered Mar 24 '10 at 12:02 AM

Eric5h5 gravatar image

Eric5h5
80.3k 42 132 521

(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:

x330
x10
x4

asked: Mar 23 '10 at 11:48 PM

Seen: 1858 times

Last Updated: Mar 23 '10 at 11:48 PM