Having a material with line around the vertice

Hi, I’d want to have a material which create line around the edge , but I dont want it to be a post process material with outline the mesh I want someting similar to the death cube in the ac valaha animus glitch or someting similar to this picture I put, I already have this material but the line stretch when I stretch the mesh and it someting I eant to avoid

Thx
Outline_Effect

Note that each face is actually two triangles, but not every edge of every triangle has the highlight. Also, there is no per-edge information available in the shaders.

To reliably achieve a look like that, I would recommend modeling the highlight geometry in your DCC tool, and export as a separate material. Put polygons on your mesh where you need to glow, and offset them out along the surface normal by half a millimeter (or whatever is necessary to avoid Z fighting.)

I’m not sure I understand everything you said but indeed having model for each edge could be a solution, but I’m sure there is a way that a material can do this effect alone, its just that I have base on material creation but its above my paygrade

There is no general way to do this without preparing the object in some way.

You can tesselate the object sufficiently in the DCC, and add a UV channel (you only need 1 coordinate) or vertex color, and test it in the shader. Make every vertex that should be part of the highlight have U coordinate 0 (or color red = 0) and make every other vertex have a higher value (1.0 or whatever – you may in fact have to tweak this to get the edge to sit right.)

Note that you can’t do this with a cube with two triangles per face – every vertex is part of a highlight, so the interpolation between the edges will just stay at “all highlighted.” You need, at a minimum, a vertex in the center of each face, and you’ll get better control if you have more tesselation.

Then do one of two things:

  1. Map a texture to it, that is bright where you want highlight, and dark where you don’t. Add this texture to the Emissive output channel in the shader.
  2. Read the value in the shader, and compare the value to some threshold (like 0.25.) If it’s less than the compare value, output bright, else output dark.

Come to think of it, you can even compensate for scaling, by making the cut-off threshold configurable. If you scale the object 3x, make the cut-off 1/3 of the default. You could make this a material parameter.