Trying to create a semi-transparent material with outlines.

While I feel quite confident programming in Unreal I still struggel when it comes to Materials.
I’m trying to create a Material that will have a similar look to this.


I got it mostly working, but still have some things that I can’t get to work.

  1. I have not been able to solve the top and bottom. How do I make the top completely transparent and not use the gradient. Is that even possible?

  2. I can’t get the outline to work properly. I think it’s a problem with how I create it (using “generatedRoundRect” with small corner radius). Making this Box smaller will bring in the Edge and it will become visible at some point while also making all the other borders bigger.

    It’s not the biggest problem as it just doesn’t work on the side.

I’ve also tried using different approaches to do the outline with post processe but I can’t get it to work with the transparent material. Some solutions I have found online regarding this suggest changing the “blendable location” in the PP material are not working for me.

Is this effect even possible to do in material and work on different models?

Blueprint: semi-transparent material with outlines posted by anonymous | blueprintUE | PasteBin For Unreal Engine

1 Like

While it may be possible the generic approaches won’t work with transparent materials. Post process won’t work because they do not write to some buffers, like scene depth, an important part of most edge detection materials.
There are ways a mesh could be set up in advance to allow this. I ran across a topic in the past that achieved material only edge detection by face weighting the mesh vertex normals.

It could also be achieved with clever UV mapping.

As for changing how the effect works based on whether it’s the top or side, once again you’d use the mesh normals by creating a mask. If you need help doing that, it’s one of the most commonly tutorialized effects, usually for adding procedural moss/snow to a mesh.

Oh, that looks interesting. It looks like he never shared any details of how he did it, and the function is no longer available.

Any idea how the face weighting of the vertex normals would work.
For the PP lines it works with ScreenDepth, pixel shifting and subtracting the two from each other.
I thought something similar might work, but I’m not sure how you would accomplish the pixel shifting of the vertex normals

Ah yes, you’re right, I’ve seen that a few times, but for some reason I didn’t think to use it here. Thank you.

Face weighting normals is usually something you’d do in the 3D modeling software. The process varies per program, but for blender I’m pretty sure it’s just a mesh modifier you can apply.