How to project an overlay on top of existing mesh?

Hi guys. I’m looking for pointers on how to do the following 3 things:

  1. Display/project an overlay on top of a hex tile (mesh).
  2. Ability to toggle this overlay on and off.
  3. Ability to customize it (mainly color and opacity)

I read about Decal and it sounds like something that would work but I didnt entirely get the result that I want. The geometry of decal is always a cube and Im not sure if I can change it to another shape that would match with the target face of my mesh: a hexagon. From what I see if the decal is bigger than the target face then it would also project onto faces perpendicular to the target face.

Also some background of my end goal: I want to recreate this scene from a childhood game, basically a turn based rpg.

eoa3.jpg

When a character is clicked, the game shows an overlay on top of tiles the character can move to. I figure this is 2D so the developer might have just built the grid separately, layered it on top of the background and toggle the overlay on or off.

You can use an alpha mask to make the decal whatever shape you want.
However, the decal will apply to everything, not just the hexagonal base. You would have to disable decals for things above it which means you can’t use effects like blood splatters or burns for it anymore. (or make a very thin decal that slips between the base and the object above it, but it’s prone to artifacting)

I think a better approach is to make the the hexagonical graphics you want to apply a part of your material. You can toggle and blend layers/attributes through blueprint or c++.

Thank you for your input. I will look into blending materials.

Last night, I ended up creating a new texture + material, using toosl like Blender and Illustrator. Here’s the steps:

  • Unwrap the hex tile 3d Model in Blender and export UV map .
  • Export the material that comes with StarterContent pack into a png file.
  • Create a new texture via Illustrator.
  • Import it to UE4 and create a new material based on this.
  • Setup onclick for the actor (hextile) and switch the material via c++.

I think this will do it for now.
I also read about Material-Layer/Layered-Material, but they are rather complex and still in Beta so I didn’t want to try that yet. Granted I don’t have much background in 3d modelling or creating texture either.
This is just a prototype so I simply want something functional at minimum. Will definitely revisit this though once I have the basics down.

You could also put a plane with the masked overlay material on it on top of the hexagon, then make the plane visible or invisible. It sounds like a dirty and ineffective workaround, but planes with masked materials are often used for things like that in particle systems.

Thank you. That totally makes sense.
Theoretically speaking, I believe that would double the mesh required for a map of n by n right? A plane in this case could simply be another hex mesh but scaled and positioned right above a regular tile and can be toggled on/off visibility wise, or change the material on the fly.

No, this would be unnecessarily expensive. Just use a simple plane like it’s already included in the engine or starter content and place it above the hexagon. Like this, but as a separate mesh of course:

Then use a translucent or masked material with a 2D-hexagon and apply it to the plane with an alpha channel like this (illustration):

The plane just acts as a display of the material, it don’t needs to be more complex.

Thank you!
I tried your approach and it also works as I wanted. I went ahead and convert it to static mesh so I can spawn it and attach it as a component to my hex tile actor in C++.

The only difference here would be the addition of a plane mesh in your solution or more textures in my solution. Either way I have to switch the texture/basecolor of the material during run time.