Baltor Get started

Gallery / Godot shaders

Full-screen ink edges from depth and colour

In your harnessGodot shaderMIT

Draw ink lines over a 3D scene where depth or colour changes sharply: a Laplacian of inverse depth finds silhouettes and creases, a Sobel filter on luminance finds colour borders. Optional paper tint for a drawn look.

Render of Full-screen ink edges from depth and colour
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Render modes
unshaded, cull_disabled, depth_test_disabled, depth_draw_never, skip_vertex_transform, fog_disabled
Parameters
screen_texture (sampler2D), depth_texture (sampler2D), line_color (vec4 = 0.05, 0.05, 0.08, 1), line_width (float = 1), depth_sensitivity (float = 8), color_sensitivity (float = 1.5), threshold (float = 0.3), paper_mix (float = 0) and 1 more
Result
The scene with dark lines along silhouettes, creases and colour borders, optionally faded toward paper.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/post_edge_detect/

Limits. Lines are found in screen space, so their width is in pixels and does not scale with distance. Transparent objects are not in the depth buffer and only get colour edges. Very distant geometry can produce faint depth lines from precision. The pass sees only what is drawn before it; draw order relative to other transparent passes is not controlled.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 61.5 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, opengl3 compatibility (Mesa llvmpipe, Xvfb)
Checks
contract static, engine run, engine log clean, shader in scene, capture written, render not uniform, shader changes pixels
Techniques
Laplacian of inverse view depth for silhouette and crease detection, Sobel operator on luminance, Depth reconstruction with INV_PROJECTION_MATRIX
Tags
godot shader, spatial, post-process, edge detection, outline, sobel, depth buffer, ink
Identity
library.supply.creative_originals.07a116501ae48d65461c68e5.62ebcec32a89f416
Version
62ebcec32a89f4160b016b3107edb137d6292e0a8ac00650b2db70de48eb07ea

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.