Using a texture2d mask for input on WorldPositionOffset?

I want to apply a mask on a material for leaves on a tree to control the wind effect.

For this I’d like o use a texture mask, so I can have a gradient moving out from the branch to the tips of the leaves.

However it appears it doesn’t allow a texture mask to be plugged into WorldPositionOffset in the material. Error: “Invalid node used in vertex/hull/domain shader input”.

Is there any way around this, or do I need to create the masks using just other nodes in the meterial editor?

there’s no way around this in UDK.

Shader Model 3 (DX9.0c) supports it as a feature but since the UE3 renderer started as DX9.0 (SM2) they never supported the feature, even after deprecating SM2.

if you have the full UE3 source code you can just remove the case in the code that triggers the material error, and then the entire thing will actually work (I did it at work in a UE3 project)

Instead of using a texture, you have to use vertex colors. Paint the vertices black if you don’t want them to move, white for full movement range. Then in your material, multiply the movement by vertex color.

Thanks for the tip about removing the code that triggers the error @Chosker. If I get tired of vertex painting, I might give that a try.

Very interesting to know if we update the source then this works. Thanks again for the info.