Baltor Get started

Gallery / Godot shaders

Parallax occlusion mapped procedural bricks

In your harnessGodot shaderMIT

Brick wall with real-looking depth on a flat surface: the view ray is marched through a procedural brick heightfield in tangent space, so mortar lines sink, bricks occlude each other at angles, and the normal comes from the same height.

Render of Parallax occlusion mapped procedural bricks
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Shader type
spatial
Parameters
brick_color (vec4 = 0.62, 0.26, 0.18, 1), mortar_color (vec4 = 0.72, 0.7, 0.66, 1), bricks_across (float = 4), bricks_down (float = 8), mortar_width (float = 0.06), bevel (float = 0.08), depth_scale (float = 0.05), steps (int = 24) and 1 more
Use it on
A mesh with UVs and tangents (Godot primitive meshes have both).
Result
A red brick wall whose mortar lines look recessed and whose bricks occlude each other at angles.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/parallax_occlusion_bricks/

Limits. The silhouette stays flat: only the interior of the surface shows depth. Shadows and depth are the flat surface's. Cost grows with steps. Strongly curved surfaces bend the illusion. The march runs in UV space, so non-square UV scaling skews the depth.

Details

Kind
Godot shader
Engine
Godot 4.3 or later
Files
11 files, 74.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
Parallax occlusion mapping with linear refinement (Tatarchuk 2006), Procedural staggered brick heightfield, Normal map from height differences
Tags
godot shader, spatial, parallax occlusion mapping, bricks, procedural, heightfield, wall
Identity
library.supply.creative_originals.151198dd54748c6ee562d7f7.24744778e6da2165
Version
24744778e6da21658d62a44f9ec7f22caec7bcb2b33c8fe8c76a0b5cd141ed33

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.