Terrain texturing

Color by height in the shader:
Not needed but it give an base. I use real-world value, plain from 20 to 300m, then forest from 300 to 2000m.

Create the base masks:
These mask are created by script with the same logic.

Generate slope mask and flow mask:


Generate the fields noise texture, the gradient is transparent until 0.5, red will not “render”

Duplicate the noise texture and change the return value to div, change the color ramp to black/white only and move the black until a thin line in the border stay.

The field mask:

I remove the field border from plain mask.

I add the field border to forest mask.

At the end i use the slope and flow mask to add more details.
For the colormap its a noise texture with 2 colors for each “biomes”

var grass_colors = [Color("2d4c1dff"),Color("4b6327ff")]
var canopy_colors = [Color("1a2e1aff"), Color("2d472cff")]
var peak_colors = [Color("8d8671ff"),Color("b9a47eff")]
var erosion_colors = [Color("6d5a41ff"), Color("8d8671ff")]

Result.

Closer look.

3 Likes

This is good work, exactly what i was thinking about. Terrains should have procedural textures, and probably procedural biomes etc.

Ive used Gaia software a bit, and recently i looked at the rocks in Skyrim - they are apparently hand crafted and placed to compliment the terrain but i think a rock and cliff mesh should be procedurally generated.

Simulated erosion could create a mud mask or a gravel mask etc, waterways could be simulated into the terrain too.

You can also add turbulence to the height gradient so height+ noise >valwould vary over the terrain.

Any plans on texture shaders using the masks?

Looks interesting. Well done