DEV Community

Tâm Trần Ngọc
Tâm Trần Ngọc

Posted on

I Let Two Gradients Do All the Terrain Coloring for Me — Here's How It Works

Been working with Polaris for terrain in Unity and wanted to share one of its shading modes that I keep coming back to — Gradient Lookup.

The idea is straightforward. Instead of building a splat map stack or painting texture layers by hand, two gradients drive the entire terrain color.

How it works

Color By Normal reads the surface slope. A face pointing straight up is flat ground — a face pointing sideways is a cliff. Map colors across that range and your terrain automatically separates cliffs from flat areas without any manual painting.

Color By Height reads elevation. Bottom of the gradient is the lowest point of your terrain, top is the highest. Set your altitude zones — sand, grass, rock, snow — and every part of the terrain picks up the right color automatically.

Blend By Height is a curve that controls which gradient wins at each elevation. Keep it low at the bottom and top so height color dominates — pure sand at the riverbed, pure snow at the peaks. Raise it in the mid-range so the slope gradient takes over where cliffs are most prominent.

The catch to watch for

The gradients map across your terrain's full height range, not just where your sculpt actually sits. If your terrain never reaches its maximum height setting, the upper gradient colors never appear. Adjust your gradient stops to match where your terrain actually lives.

On top of that

You can paint an albedo map and a metallic map over the gradient result for close-up detail — dirt paths, mossy patches, wet rocks. The gradient handles the broad color, the painted maps handle the finishing touches.

Full tutorial with the complete walkthrough: Youtube

Top comments (0)