Based in:Unity Tutorials: Diamond-Square Procedural Terrain tutorial
Renders a procedural terrain using Diamond Square common and famous algorithm
The project contains the scripts below on Assets/Scripts folder:
MeshGenerator: This is only to understand the theory about creating mesh with triangles and vertices.PS: Attach this script to a any empty gameObject and see the result :)
DiamondSquareTerrain: Generate a diamond square terrain, with Diamond and Square steps
Download Unity 2019+ and open this project
Open the scene
Assets/Scenes/SampleScene.unityClick on
Playbutton on Unity editorChange the parameters
Divisions,SizeandHeightand click on Update button. The terrain will be generated again
Posts
- [WIKIPEDIA]: Diamond Square Algorithm
- [MEDIUM]: Diamond-Square Algorithm Explanation and C++ Implementation
- Perlin Noise vs Diamond Square
- [DEMO]: Terrain generation with the diamond square algorithm
Videos
