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);
}
Tags
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

Line pattern cell shading

White line after texture – chatgpt

3-Line Color Array Palettes, with Shifting

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
TheYellowArchitect
1 year ago

Too good to be true. Thank you.

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