« Z-up shader | Main | Basic Material »

Wiggle Shader

This is a variation of the Basic shader that uses vertex colors to move the verts of a mesh.  This shader is perfect for things like banners and webs that you want to look like moving cloth but don't want the costly cloth simulation.


here's the section that does all the work, this can be added to the basic shader in lieu of bump offset (both and you are getting into an expensive shader).  The parameter "wiggle speed" determines how quickly the cosine and sine functions will cycle.  This is then multiplied by the chosen vert colors for different movement.  Green verts are moved by a cosine and red by a sine.  A second parameter controls the actual offset of the verts.  All this eventually goes into a switch parameter if it's not necessary at all times on a model (parameters can be changed via kismet in game).  at 59 instructions this is actually cheaper than the basic shader BUT gets more expensive the more verts the shader ends up moving, so use on high rez meshes at your own peril.

What a mesh with vert painting would look like.

Vert painting is located in maya along the top shelf of options (under polygon modelling) to the right.  I typically use apply color as it provides finer control than simply using the paint tool.

when importing, make sure to check "replace vertex colors" otherwise if you are tweaking the vert colors it will not update the mesh in game.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>