Technical notes for Ice Cave. The project page shows the finished piece; this one is about how it works.
The ice cave is generated by one script that rebuilds the whole Houdini scene from nothing and exports it for Unreal. This note covers the distance-field model, the scallop noise, how material boundaries stay smooth, and the triplanar ice shader that lets the walls skip UVs entirely.
One script, four build modes
build_icecave.py builds the network, cooks it, saves the hip and exports FBX. The same seed always gives the same cave. Different modes trade quality for speed:
| Mode | What it does | Time |
|---|---|---|
| preview | Low resolution, quick check of the layout | ~10 s |
| final | Default. Walls without UVs, floor, channel and outside unwrapped | ~1 min |
| final --no-uv | No UVs anywhere | ~50 s |
| final --wall-uv | Walls unwrapped too, then relaxed with ARAP | ~3 min |
The saved hip is self-contained: the terrain samples from Unreal (on a 5 m grid) and all the Python live inside it, so the folder can move and the file still opens.
The cave as a distance field
The glacier is a raised tongue of ice, cut off by a cliff at the front. The cave is everything subtracted from it: an elliptical arch swept along a centreline, a flat floor, a meltwater channel, side pockets and skylights. In a signed distance field that subtraction is one line, max(ice, -cave), and it never produces broken geometry however the centreline moves. A VDB reshape then removes any ice thinner than 1 m, which would otherwise leave paper-thin flaps.
The tunnel is edited with a curve and five arrays, one value per control point: arch half-width, arch height, whether the point is inside the glacier, and the channel's width and on/off.


Scallops from stretched Worley noise
Real ice cave walls are covered in scallops: shallow bowls shaped by moving air and water, steep on the upstream side and stretched along the flow. They are built from anisotropic Worley noise: each cell is stretched along the tunnel, the bowl's centre is pushed upstream, and the edges between neighbouring bowls stay sharp.
| Layer | Cell size | Depth |
|---|---|---|
| Large | 1.8 m | 0.6 m |
| Medium (alternates with large) | 1.25 m | 0.45 m |
| Fine | 0.6 m | 0.1 m |
| Micro | 0.28 m | 0.025 m |
The shape controls that mattered most were the elongation (1.35, where 1 is round), the asymmetry (0.45 steep upstream, 0.3 gentle downstream) and a bowl exponent of 1.25 that sets how sharp the ridges are. Two safety controls keep it believable: the scallops fade out in a 2.2 m band at the foot of the wall, and no displacement may carve deeper than 40% of the local ice thickness, so thin roofs never get punched through.
Smooth boundaries between materials
Wall, floor, channel and outside ice each have their own material slot. Cutting slots by triangle gives a stair-stepped edge. Instead, each boundary is the zero line of a continuous field (inside vs outside, floor vs wall), and a snap step slides the nearby vertices along their edges onto that line. The boundary becomes a smooth curve. Every displacement is also multiplied by a smooth weight from the same fields, so the surface never tears at a seam.
A triplanar ice shader with fake depth
The walls ship without UVs because the ice material doesn't need them. It is one Custom node in M_IceWall_Triplanar that works entirely from world position and world normal:
- Triplanar projection: colour, detail and normal textures are sampled three times, projected along X, Y and Z, and blended by the normal raised to the 4th power, so the transition between projections stays tight. Normals use a whiteout blend in world space, so no tangents are needed either.
- Depth without geometry: two inner layers are sampled at points pushed into the ice along the view ray, a world-space parallax. The push grows at grazing angles (1 / N·V, clamped), which is what makes the ice read as thick instead of painted.
- Surface vs inside: a Fresnel term shows more of the clear surface film at grazing angles and more of the deep blue interior when looking straight in.
float3 p1 = (WorldPos - ViewDir * Depth1 / max(NdotV, 0.25)) / (Tile * 0.63); // inner layer 1
float3 p2 = (WorldPos - ViewDir * Depth2 / max(NdotV, 0.25)) / (DetailTile * 1.9); // inner layer 2
base = lerp(surfaceColour, innerColour, Inner * (1 - pow(1 - NdotV, FresnelPower)));

The generator bakes what the shader needs into vertex colour:
| Channel | Drives |
|---|---|
| R | Thin-ice glow: light transmitted near skylights and thin roofs, modulated by the parallaxed interior so it reads as depth |
| G | Wetness: blends roughness from dry to wet |
| B | Sediment at the wall foot, broken up by the detail texture |
| A | Scallop bowl depth: tints bowls and ridges differently |
Everything is exposed on the instance (tile size, both parallax depths, inner strength, Fresnel power, tints, glow, dirt, dry and wet roughness), and a UseVertexColor switch gives neutral values for meshes without vertex colour. The FBX is imported with Vertex Color set to Replace, so the colour arrives in Unreal as baked.

Into Unreal
- Nanite: every material slot is opaque or masked, so the whole cave renders as Nanite.
- Collision: Use Complex Collision As Simple makes the whole cave walkable with no blockers.
- Rocks: 12 procedural rock shapes at 3 levels of detail. A Python step picks 1,600 positions on the floor with a size distribution, no overlaps and a margin from the channel. Rocks follow the floor automatically when the wall sliders change.
- Axes: the export converts metres with Z up to centimetres with Houdini's Y up, so the FBX lands in Unreal at the right place with no manual offset.
What I'd keep
- Model in distance fields when the shape will keep changing. Booleans on meshes would have broken many times over.
- Snap material boundaries to iso-lines of a field instead of cutting along triangles.
- When UVs are expensive, shade from world space: triplanar projection plus view-ray parallax goes a long way.