UIPF Shader Interaction
UIPF comes with one master material and a number of instances derived from it. If you would like to simply use our shader with your foliage, please do! There is an instance with each foliage item included with the plugin, and these would be a great starting point for similar types of foliage you want to configure. There are also some parent instances which have the default features enabled for their relevant uses (such as an instance for foliage authored for pivot painted wind, one configured for small plant bending, etc - pictured below.
Depending on which features you’ve enabled in the M_Foliage - Features category of a foliage instance, you’ll have values to customise in a number of categories and material functions. I’m only going to go over the specifics of some of the most important ones here, but each variable and material function has a description if you need more info on what each is doing.
Alternatively, you can simply add these material functions to your own materials as desired if you only want one or two elements (such as Grass Flattening etc.
Changing Wind Direction:
Wind direction and amplitude can be set in MPC_UIPF, in the root of the UIPF Content folder.
Below is a table of each included material parameter category. Any category prefixed M_ is part of the master material, and anything prefixed MF_ is a self contained material function that you can add to any of your shaders as desired!
This group is where you can enable or disable any desired features included in the master shader. This material has been designed to unify as much of your foliage as possible, so you can have a cohesive look even if you’re using foliage from multiple sources.
This is why the single shader is setup to be used with both pivot painter and non pivot painter foliage alike, with all the options you might want to switch per instance exposed as options.
This value is how you can change how wobbly a plant is. Lower = less wobble, higher = more.
Much the same as the pivot painted version, but you have the option to enable bendy rotation. This will make the foliage flop around more the higher up the world position is from the instance origin. Setting plantheight to roughly the world height of an average instance will yield best results.
These values are all used to handle how bendy a plant or foliage is during shader interaction or impulses. I highly recommend going off what these values are set up as in relevant plants.
The main one you will probably want to care about is InteractionStrengthPwr. Higher values here will cause plants to stop wobbling sooner, lower values they will wobble for a longer time after being interacted with.
Just two parms here, one for adjusting the color of your albedo, and the gusty spec value is a multiplier applied to the foliage specular in the wind gust areas. This allows gusts to bee visible in the shader at distance even where you mightn’t see WPO. This is a bit of a hack, so by all means just set to 1 and spec won’t be changed with wind gusts.
These values drive the pivot painted wind gusts.
Each value multiplies the speed or max rotation of each instances pivot painted wind shader. The gust material function (covered further down) is responsible for lerping between the base and max values.
This is the material function for flattening grass. Instances are scaled around their origin + the origin offset vector param, and you can adjust the squash in all 3 axes using the squash amount vector param.
A lower power will result in grass remaining flatter for longer, and a higher flatten mult with boost the strength of the flattening effect.
This is a simple bonus material function I put together to add world space scale variation to foliage instances for a more dynamic and realistic tufty look. This is used in the long and short grass shader, and the ferns too. You can use any shader to add different variation - black is 1x scale and white is SizeVariationAmount scale.
UniformObjectScaling will scale an asset as a whole, unticking this will scale the asset in world space so for example you could have a large area of grass covered by an instance and it could still be smoothly included in the variation.
UIPF Masks interaction in Z space using this function. The Z height is the heigh above and below interactor components in world space that will be considered for interaction, and the Pow param controls how sharp the falloff is.
The existing setting are great for human scale interactors.
This is a basic material function that bends foliage away from players or interactors positions. This is a naive bend and doesn’t cover trailing interaction.
This is another bonus material function that provides wind gusts in world space. Recommended not to change these parameters per instance, and rather change them in a parent instance so you can have unified wind gusts for all your foliage.
Wind direction and amplitude can be adjusted in the material parameter collection MPC_UIPF
These vars drive a simple wind node in the case that you aren’t using pivot painted foliage with this shader.
This adds a large scale rotate about axis wind effect (in the UIPF wind direction) to any non pivot painted foliage. Quite effective and allows non pivot painted foliage to hold up against the rest.
These categories are all default pivot painter settings (with the one exception being is UIPF is overriding the direction vectors so you must change those in the material parameter collection MPC_UIPF).
Documentation on how to use Pivot Painter wind can be found at https://docs.unrealengine.com/en-US/Engine/Content/Tools/PivotPainter/PivotPainter2