Parallax¶
Pseudo-3D perspective shift from a height map, via ray-marched parallax occlusion mapping.
filter/parallax re-projects its input as if the height map extruded it
into relief viewed from an angle:
The height map’s luminosity gives each pixel a height from 0 to 1.
For every output pixel, a view ray angled by
directionis marched through the height field until it hits the surface.The input is sampled where the ray landed — tall features lean away from the viewer and cover what is behind them.
search filter, synth
noise(ridges: true)
.parallax()
.write(o0)
With the default heightMap the input acts as its own height map
(bright = tall). Wire a different surface to displace one image by another’s
relief.
Parameters¶
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
surface |
|
Height source; its luminosity is the height field |
|
vec3 |
|
Viewer angle: straight down |
|
number (0–1) |
0 |
The height plane that stays anchored: 0 locks the ground so features rise out of it; 1 locks the peaks so valleys sink inward |