Midpoint Displacement // Terrain Rendering episode #3
OGLDEV OGLDEV
9.2K subscribers
3,231 views
0

 Published On Jan 23, 2023

This is the third episode in a series where we follow along "Focus on 3D Terrain Programming" by Trent Polack. In this video we study the second out of two algorithms which appeared in the book to procedurally generate a heightmap. This algorithm is called 'Midpoint Displacement'.

Timecodes:
0:00 Introduction
0:56 Algorithm overview
3:40 The Diamond and Square steps
4:21 Software Architecture
4:47 Start of code review
8:26 First run
8:46 Non power-of-two problem
10:40 Edge anomaly
11:02 Conclusion

"Focus on 3D Terrain Programming" by Trenk Polack: https://www.amazon.com/Focus-Terrain-...

Make sure to watch all the previous tutorials in the "Terrain Rendering" playlist at    • Terrain Rendering  

Please visit https://ogldev.org to see more of my tutorials on modern OpenGL.

Link to source: https://github.com/emeiri/ogldev/blob...
To get the version of the code that was used in the video checkout the tag 'TERRAIN3'.

OpenGL 4.6 specification: https://www.khronos.org/registry/Open...

Feel free to comment below.

Credits:
* Music: "Elevate" by https://bensound.com
* Image: https://www.usgs.gov/programs/earthqu...
* Image: https://www.nature.com/articles/ncomm...

Email: [email protected]
Instagram: @ogldev1
Github: https://github.com/emeiri/ogldev.git
Twitter: @ogldev
One time donations (Paypal): https://ogldev.org/donate.html
Patreon:   / ogldev  

Enjoy,

Etay Meiri

#opengl #ogldev #opengtutorials

show more

Share/Embed