Line art

simple line art effect, change strength to modify detail

modifed from this shader

Shader code
shader_type canvas_item;
uniform float strength = 0.01;
uniform vec4 color : hint_color;
void fragment(){
	vec3 current_color = texture(TEXTURE, UV).rgb;
	vec3 right_color = texture(TEXTURE, UV + vec2(SCREEN_PIXEL_SIZE.x, 0)).rgb;
	vec3 bottom_color = texture(TEXTURE, UV - vec2(0, SCREEN_PIXEL_SIZE.y)).rgb;
	float r_distance = length(current_color - right_color);
	float b_distance = length(current_color - bottom_color);
	COLOR.rgba = (r_distance > strength || b_distance > strength) ? color : vec4(0);
line art, postprocessing
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

White line after texture – chatgpt

Pixel art trail

RotSprite-Like Algorithm for Cleaner Pixel Art Rotation

Notify of

1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
5 months ago

Too good to be true. Thank you.

For anyone wanting to try this out, try (godot logo) with value 0.07)