Material Functions for UE4

Cartesian to polar conversion node

To my surprise, UE4's material editor doesn't include a cartesian to polar coordinate converter, which could be useful for UV manipulation and VFX. Here's a quick material function to do just that. It takes a couple of inputs: a vector 2 (UV coordinates) and a scalar for tiling. The function outputs a vector 2 containing the polar coordinates (angle and magnitude).


Cartesian to polar implementation, right click and open the image in a new tab if needed


Node usage in the material editor


Here's a quick implementation of the node. The left gif is the texture as-is with some emissive applied and a panner node to scroll. The right gif is the same setup, panner and all, but with the UV coordinates running through the MF_Cartesian2Polar node. The nature of the coordinate system causes distortion near the edges and center, the X/U Scalar input can help with that.

Download the function here.

Grass Wind via Noise Texture

Here's a simple material function that takes a texture object as an input to displace grass. I created the noise texture below in Substance Designer to give the grass a ripple-ey effect. The function outputs the noise texture (I used it to help with coloring the grass), a linear gradient (again for color), and a mask based on vertex normals (to assist with the offsets). Check out the results below.


Wind displacement graph


Function usage in the grass material


Lotsa grass that isn't optimized, but with a bit more love and care the results can be really nice! Here are the textures I used to create the grass:


©2021 Bruce Evans