Post

An easy approach to procedural terrain: heightmaps Start with a tesselated plane, and calculate the height for each vertex. In our example, every vertex samples cheap value noise: height = noise(position.xy * frequency) * amplitude; Frequency -> xy scaling of noise Amplitude -> terrain height

One layer of noise is smooth, but you need more to get convincing terrain. You can use fBM (fractional brownian motion). Sample the noise repeatedly, at different scales, adding more detail iteratively. Extra: pow() reshapes the height range. I used "3" to flatten valleys and make peaks stand out.

There are other types of noise. Voronoi noise scatters a point inside each grid cell, then calculates the distance to the nearest one. Checking the surrounding 3×3 cells gives us a completely different noise function.

fBM isn’t a special kind of noise. It’s just a way of layering noise. Here, we're layering the "ridged" noise from earlier. Notice this gives a much rockier effect.

A neat trick is to use noise derivatives, which tell you how steep the terrain is. Use that slope to reduce the smaller details in steep areas, and regular fBM starts to look weathered. Quick cheapie erosion effect.

Terraces are another cheap shaping trick. Split the height range into steps, but keep a short ramp between each plateau. That gives us broad, flat areas without making every transition a vertical cliff.

Obviously, you can combine these however you want. Here we used low-frequency terraces to create the large shapes, then added the weathered fBM on top.

The terrain looks decent, but it's lacking a sense of depth. Basic distance fog is easy: blend toward a blurred sample of the sky as the terrain gets farther away. It works, but it doesn't look awesome.

This is a cheap height fog from Crytek's 2006 presentation. Instead of looking only at distance, it integrates an exponentially thinning fog layer along the camera ray. Valleys fill with dense fog, while the peaks stay relatively clear.

One last little trick: Normal fog blending kinda sucks, it basically just blends towards a colour. Instead, split that into 2 separate calculations, one for extinction and one for in-scattering. • extinction = darker silhouettes • in-scattering = brighter haze

0 reposts2 likes