3D Outline

Simple Outline for quick 3D. You have to add it into “next pass” of your material.

Shader code
shader_type spatial;
render_mode unshaded, cull_front;

uniform bool enable = true;
uniform float outline_thickness = 0.05;
uniform vec4 color : source_color = vec4(0.0);


void vertex() {
	if (enable==true) {
	VERTEX += NORMAL*outline_thickness;
	}
}

void fragment() {
	if (enable==true) {
	ALBEDO = color.rgb;
	}
}
Live Preview
Tags
3d, outline
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments