Masking meshes via vertex paint ue4

With a photoshop background masking is cornerstone to how I think about creative stuff in general. With no time to learn 3d/make meshes I will have to rely on epic for most content. However their meshes will not always 100% fit requirements. Masking was the first thing that popped into my head when considering how to use part of a larger mesh, but apparently is not possible. Exporting, modifying, re importing had been suggested, but for some small thing this seems overkill – plus time to learn. No thanks. Here is a quick botch that someone might find useful for tweaking objects to fit what they need.

1. Meet quickly put together wall slide ramp thing using ctf-outside wood plank meshes. Ignoring the misaligned bits, things cutting into each other there are a few problems with the boards straight up.

sweet ramp

2. Pretend we want to include some “end” joins in the middhle of the ramp, to add a little variation. Also the longest diagonals were not quite long enough. To rectify this it is a simple matter of duplicating the planks, translating them along the existing plank axis and moving the two planks back to where they looked good. This causes some fairly glaring problems, both next to the ramp and also through a wall.

not so sweet ramp
got wood?

3. If I had created this in photoshop the ends would have been neatly masked off, however this functionality does not exist in ue4. Off to google to find a solution. These are the specific tutorials that helped.

UE4 Vertex paint tutorialLocation based opacity and ue4 vertex paint docs.

For this example only the diffuse was used but you can include normal and other attributes as well. This is well outlined in the videos above. For those that do not want to watch them, duplicate the base colour back from the multiply, change it to normals and connect it up with the vertex colour connected the same way. The material blend mode needs to be set to translucent to gain access to the opacity pin. Using existing epic meshes is easy, find the textures used in the materials and drop those in.
material setup

4. Apply this material to the planks then paint in/out sections of the mesh.

vertex painting in ue4
even more vertex painting ue4

5. Done. Turn off collision for the planks sticking out and create a blocking volume around the ramp. Not 100% sure how it works with shadows so you may want to disable casting on the mesh as well.
vertex paint masking
love those sticking out bits

A neater solution using volumes may be possible but is beyond my abilities. If you are interested check this out.


Level Design