Baltor Get started

Gallery / Godot shaders

Cutaway along a world plane with solid caps

In your harnessGodot shaderMIT

Slice meshes open along a world-space plane: everything on one side is discarded, the exposed inside shows as a flat cap colour, and a glowing band marks the cut, for cross sections and reveal effects.

Render of Cutaway along a world plane with solid caps
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Render modes
cull_disabled
Parameters
albedo (vec4 = 0.35, 0.55, 0.85, 1), roughness (float = 0.45), cap_color (vec4 = 0.9, 0.3, 0.25, 1), edge_color (vec4 = 1, 0.85, 0.4, 1), plane_pitch_degrees (float = 0), plane_yaw_degrees (float = 35), plane_offset (float = 0), edge_width (float = 0.02) and 2 more
Use it on
Closed meshes (open meshes show their real back faces as caps). Several objects can share the material and are cut by the same plane.
Result
A sphere and ring sliced open diagonally with red cut faces, a glowing seam and the inner core visible.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/clip_plane_cutaway/

Limits. Caps are the inside of the mesh, not new geometry: overlapping inner surfaces show through each other and the cap shading is flat. Discard disables some depth optimizations. Shadows are cut by the same plane.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 56.7 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
World-space plane clipping with discard, Back faces as cross-section caps, Edge distance glow
Tags
godot shader, spatial, cutaway, cross section, clipping plane, reveal, visualization
Identity
library.supply.creative_originals.d4a7963fc4634a1076f675ce.7fab61afb691c494
Version
7fab61afb691c494de6de24c62e9624aafdab358247c229a24681fadf5079083

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.