procedural terrain generation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Yahia

hello everyone,

Does anyone know how to randomly generate a perfect terrain…

Thanks

Noise textures is the way to go. Have them displace vertices using a shader.

magicalogic | 2022-10-24 05:24

:bust_in_silhouette: Reply From: Ninfur

There are a lot of different ways of making procedurally generated terrains, but usually you use some kind of noise as a base for generating graphics.

Some examples
For 2D, you could:

  • Create tiles based on the noise map values, e.g. if noise > 0.5 then create ground, else create water
  • Apply a shader directly to a noise texture to modify its color and look

For 3D:

  • Probably the simplest is to use a noise as a heightmap for a subdivided plane
  • Create meshes using marching cubes, surface nets, dual Contouring etc.
  • Create cubes if noise value is above some threshold

There are lots of tutorials out there already, try searching “procedural terrain godot” on google/youtube.

Here’s a couple:
Godot Procedural Generation with BIOMES tutorial part 1 - https://www.youtube.com/watch?v=zoE-mosUJ-I
HOW TO GODOT: Infinite procedural terrain generation - https://www.youtube.com/watch?v=rWeQ30h25Yg
Infinite Terrain in Godot 4 - The ‘Wandering’ Clipmap Terrain Technique (with LOD) - https://www.youtube.com/watch?v=rcsIMlet7Fw

Thanks for your help!!

Yahia | 2022-10-25 00:23

1 Like