Baltor Get started

Gallery / Godot shaders

Inverted hull outline pass

In your harnessGodot shaderMIT

Draw a solid ink outline around a mesh by rendering its back faces pushed out along the normals, as a next pass on any existing material, with optional distance scaling so the line keeps a similar width on screen.

Render of Inverted hull outline pass
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_front, shadows_disabled, fog_disabled
Parameters
outline_color (vec4 = 0.04, 0.03, 0.07, 1), thickness (float = 0.015), distance_scaling (float = 0.6), max_thickness (float = 0.08)
Use it on
A mesh with smooth normals and an existing base material; set material.tres as that material's next_pass.
Result
The mesh with a solid dark contour around its silhouette and along outer edges.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/outline_inverted_hull/

Limits. Hard-edged meshes (split normals, for example a BoxMesh) show gaps at the corners because each face moves along its own normal; use smoothed normals for those. Width is in object units, so non-uniform scale changes it. Inner creases are not outlined. The hull can poke through nearby geometry.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 54.8 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
Inverted hull (back-face extrusion along normals), View-distance width compensation
Tags
godot shader, spatial, outline, inverted hull, toon, next pass, stylized
Identity
library.supply.creative_originals.6dd3549f786d3e5278e63ecf.cb1bab0400e15f59
Version
cb1bab0400e15f5905af9b55d1b55d845c663d449f896327bbc2af8319202f15

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.