kuligs2 Hi, it looks like you are trying to use a deferred
way of highlighting, which is using the screen buffers.
Godot uses the forward pipeline, the way to highlight an object is to create a copy of it. You should not use the godot buffers too much, as they tend to make the materials fight each other, so if you have a refraction material, it will not affect transparent materials or other refraction materials, and it will interfere or disappear when using custom post-process effects with a plane.
1 - make sure your object has no normal seams, or bake your normals into one that does and use the normal texture. a normal seam is when there are two or more duplicated vertices, which is used to create what are sometimes known as "smooth groups". This is done to create hard edges.
This step is not important, but these seams can cause the highlight to break a bit on the seams.
2 - create a second material and apply it as a next pass over your material, like you did. but...
3 - there's an option called grow
in standard material, which will cause the vertices to expand by the normals. then set culling to front, which will cause the back faces of your material to show. finally, set the shading mode to unshaded
, this will make the material a single color (or the albedo texture color), and will have better performance.
"grow" is a vertex
shader, which means it has better performance than what your are doing with the fragment, the code is also simpler.