Material gradient mask on bottom of mesh

I’m trying to add a snow material at the base of the trunks of trees. The bark material is tiled, however I only want the snow buildup to show at the bottom of the mesh.

Does anyone know how to do this?

I would try doing it in the material if it’s possible. Maybe try putting in a new parameter like “Snow” to turn on a different section in the material to add the snow. just not sure if that will work as the material is tiled. or in that section of the new parameter try to make a layer to turn off and on and have the snow on that layer your turning off and on.

You could do it with vertex colors. Paint all the vertices black, then just paint the bottom of the tree blue. Then in the material, use Vertex Color’s blue channel to lerp from bark to snow.

I’ve found that you can set the “Address Y” to “Clamp” in the texture itself. Works nicely!

@Nathaniel3W How do you go about painting vertices? Do you mean in 3D modelling software outside of UDK?


@Coldscooter you can paint the vertex color in a 3D editor or inside the UDK editor. I would recommend painting the default colors in a 3D editor and then painting individual meshes in UDK for variation.

@Nathaniel3W Where is the vertex painting tool in UDK? This must have gone under my radar for 5 years :slight_smile:

you can also take the worldposition z minus the actorposition z divided by the height of the mesh (as a param), which will give you a gradient from top to bottom on z. then multiply/bias/etc to get it at the bottom

Hello dude. I don’t know if my idea can be of any use, however I always try to keep things as simple as possible. In my case, If I yould do snow on the bottom of trees, I would make a simple masked material with a transparent snow texture in photoshop then apply it to a simple, small and very low poly cilinder a bit wider than the bottom of the tree, and then place it at the bottom of that tree.

@udkultimate That seems more complicated, as well as adding extra draw calls if you are using more materials. And adds extra geometry to the world.

I guess it’s called Mesh Painting in UDK: UDK | MeshPaintReference

But it’s still painting RGB onto a vertex. And then your material can use the vertex color for whatever. Very useful for adding some variation to your meshes.

@Nathaniel3W Very cool. I can see this could be very useful.