The simplest outline shader (improved)
Inspired by RPaciorek‘s outline shader.
The original moves all vertices outward from the origin – which means it won’t work (as intended) on any concave shapes. Here, we instead move outward using the NORMAL, to fix that.
Attach the shader material as a next pass.
Shader code
shader_type spatial;
render_mode cull_front, unshaded;
uniform vec3 color : source_color = vec3(0,0,0);
uniform float thickness : hint_range(0.0, 1.0, 0.01) = 0.05;
void vertex() {
VERTEX += thickness*NORMAL;
}
void fragment() {
ALBEDO = color;
}

Comments 0
No comments yet.