- Home /
Vertex shader to create wind
How do I adapt the vegetation vertex wind shader for non terrain geometry (particle impostors) ?
Answer by sean · May 12, 2010 at 05:02 PM
The theory is that you figure out how you want the vertices of whatever you're applying the shader to to move (or otherwise be transformed/replicated/etc.) chop the existing transformations out of an existing vertex shader that you understand the inputs/outputs of, and drop your own transformations in, passing any additional state you need from the Unity app accordingly (not sure how crunchy Unity gets as far as defining custom metadata per vertex that could also be accessed directly in a shader without being repeatedly (sloooowly) passed in every frame; that would really be the slicker way to do physical state tracking of particles).
The specifics... I would be talking out of somewhere you don't want to hear me talking out of, since I have neither reviewed the wind shader in question nor per se mastered ShaderLab & Cg.