Displacement to Vector
Turning a height map into a vector displacement map
- height_map
- vector_displacement
A normal height map tells a renderer "move the surface up by this much." A vector displacement map tells it "move the surface this way by this much" - it's displacement with a direction, stored as three channels instead of one. If you've ever wondered why some high-end materials displace in overhangs, undercuts, and sideways, this is the map that makes it happen, and this node is the converter that gets you there from a plain height map.
The math is straightforward and worth understanding because it's the whole node. A standard height map stores a single scalar per pixel - height above the surface. This node treats that height as a magnitude along a direction you define, and writes it out as three channels (X, Y, Z). By default direction_z = 1.0 and the others are zero, so you get pure vertical displacement - functionally equivalent to a normal height map, just encoded as a vector. Nudge direction_x or direction_y and the displacement now also shoves geometry sideways, which is what lets you fake overhangs and carved detail in engines that support vector displacement (like rendering packages that sample VDM properly).
The inputs you actually set:
height_map- any grayscale-ish height input (it takes the average of channels if you feed RGB)magnitude- how strong the displacement is; the height values are centered around 0.5 and scaled by this, so this is your global intensitydirection_x/direction_y/direction_z- the direction vector, normalized internally, so don't worry about making it unit length. Keepz = 1and the others 0 for classic vertical displacement.
One nice implementation detail: it centers the height around 0.5 before scaling ((height - 0.5) * magnitude), so mid-gray stays put and you're amplifying deviation from flat rather than sliding the whole surface. Output is vector_displacement as a standard IMAGE - R = X, G = Y, B = Z - which you save and hand to whatever renderer expects a VDM.
Honest take: this is a niche node. If you're shipping materials to Unreal/Unity, you almost certainly want classic height or normal maps instead, because VDM support in real-time engines is spotty. Where it earns its place is the path to high-end offline renderers and sculpting-style workflows, or when you need to generate a VDM procedurally rather than bake one in a DCC. For that specific job, it's exactly what it claims.
It also fits the pack's bigger story: TextureAlchemy generates height maps from Marigold/Lotus depth, and this node is one of the exits from that pipeline into more exotic formats.
Install: Manager → search "Texture Alchemy", or:
cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy
Restart, then Texture Alchemist/Height → Displacement to Vector. No dependencies beyond ComfyUI's bundled torch. Shared pack gotchas: stale README folder name, and if Manager refuses a Git-URL install, that's the security level - clone by hand.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| height_map | IMAGE | — | |
| magnitude | FLOAT | 1.00–10 | Displacement magnitude |
| direction_x | FLOAT | 0.00-1–1 | — |
| direction_y | FLOAT | 0.00-1–1 | — |
| direction_z | FLOAT | 1.00-1–1 | Default is pure vertical displacement |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vector_displacement | IMAGE | — |