Edge Glow Applying to Entire Surface

Hello, I am attempting to create a material I can use to create an edge glow around some imported static mesh models. I have set up the material and it works on basic geometry but when I attempt to apply it to our static meshes the entire surface of the model glows instead of just the edges. Images of the issue and material set up below. I have a feeling it might have to do with how I have set up the edge emissive texture.

Does anyone have some ideas on how to correct this?

I want the effect from the cube on our static mesh but as you can see, its just glowing the entire model and not just the edges. Material blueprint is below.

Your material nodes are setup so the edge of the texture coordinates (or UVs) glow, not for the edges of the model to glow. The fresnel can give you an outer edge glow effect, but won’t give you those inner edges.

You could use your setup and custom UVs for each model for the effect you want, but that would take a lot of work per model.

If you want the look to exactly match your box example, you might be best off baking curvature maps and using that as a mask to apply the glow. I don’t think there’s an easy way to do that completely within UE4, but wouldn’t be surprised if someone managed to do it already.

I found a curvature material node you could use as the mask for an edge glow effect FWVN edge wear material function for dynamic procedural texturing — polycount

maybe this video would help?

I know this is an old thread, but I struggled to understand why this wouldn’t work for a while and it may be helpful to others trying to achieve a similar thing if they understand why it doesn’t work or what they would have to do in order to make it work.

The Intent:

You’re trying to make a material shader that will give an edge glow to anything that has it applied.

The Problem:

The unreal material shader does not know where the “edges” are technically, that is the purpose of UV mapping a model to define how everything fits in the UV space- so this effect largely depends on how each model is UV unwrapped. This can vary from model to model, and in order to achieve an edge glow effect you would have to unwrap the UV’s in a specific way. My guess why the entire “C” is glowing is because it is not unwrapped at all. So it’s sampling the origin of the UV.

The Alternatives

The method mentioned above using a curvature material shader which uses “Vertex Normals” information is a great method for edge wear but may not work well as an edge glow. This will not work on models that do not have beveled, chiseled, or angled edges and your glow size will be limited by the exact size of the modeled edges.

You definitely could use a post processing material but if you’re looking for anything other than a solid line around things- the performance demands will only increase as you add complexity to a post processing material.

The Solution

UV Unwrap Edge Faces:
Here is an example of how you could unwrap your model to prep for an edge glow material shader. This is a basic unwrap, depending on your case you could add more geometry to get an even more specific edge glow effect.

EdgeGlowModel

The Material Shader:
By moving all of the “middle” vertices left and the “edge” vertices to the right in the UV space, unreal can read the transition between those positions as a linear gradient, which you can control to your desire. Here is a simple gradient material shader.

The Final Result

Now you have some freedom to add more options such as a hard edge glow or a soft edge glow, or anything in between by adding more to the shader code.


I hope this helps!