Тёмный

Terrain Tessellation Shaders // Terrain Rendering Episode 13 

OGLDEV
Подписаться 10 тыс.
Просмотров 2,7 тыс.
50% 1

In this video we learn how to use the tessellation pipeline in order to achieve dynamic level of detail of our terrain mesh.
📚 Timecodes 📚
0:00 Intro
0:37 Background
1:17 Tessellation for terrains
1:53 Creating the vertrex/index buffers
3:09 The vertex structure
3:39 The normal vector
4:17 The vertex shader
4:30 The tessellation control shader
8:14 The tessellation evaluation shader
9:14 The fragment shader
11:11 Outro
📚For more information:📚
🔹Geomipmapping video tutorial: • Geomipmapping // Terra...
🔹Tessellation article by LearnOpenGL: learnopengl.com/Guest-Article...
🔹Calculate the normal from the height map: stackoverflow.com/questions/4..., / normals_of_a_heightmap...
Make sure to watch all the previous tutorials in the "Vulkan For Beginners" playlist at • Vulkan For Beginners
Please visit ogldev.org to see more of my tutorials on modern OpenGL.
🔥Link to source:
github.com/emeiri/ogldev/tree...
If you want to get the same version of the code that was used in the video checkout the tag 'TERRAIN13'
Feel free to comment below.
🔗Contacts:
🔹Email: ogldev1@gmail.com
🔹Instagram: @ogldev1
🔹Github: github.com/emeiri/ogldev.git
🔹Twitter: @ogldev
🔹One time donations (Paypal): ogldev.org/donate.html
🔹Patreon: / ogldev
🙏Credits:
🔹Image by Gerd Altmann from Pixabay.com
🔹Video by Attila Pergel from Pixabay.com
Enjoy,
Etay Meiri
#vulkan

Опубликовано:

 

23 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@OGLDEV
@OGLDEV 2 месяца назад
Clone the sources: git clone --recurse-submodules github.com/emeiri/ogldev.git If you want to get the same version that was used in the video you can checkout the tag 'TERRAIN13'. Build on Windows: Open the Visual Studio solution: ogldev\Windows\ogldev_vs_2022\ogldev_vs_2022.sln Build the project 'Terrain Rendering\Terrain13'
@StinkySkunk100
@StinkySkunk100 Месяц назад
I'm glad I found this. I've never used OpenGL (or C++ for that matter) and my first project was going to do an infinite terrain generator. I implemented it by generating squares of terrain, with the normal, texture coordinates, and height values and just passing all that into the vertex shader and it converted it to world space before passing it to the fragment shader. Though I really wanted to do tessellation because I thought it was really neat and would allow for much bigger landscapes. I was about ready to give up until I found this and your other videos which have been the best explanation I've seen on tessellation shaders. If I understand it right for something like a procedural generated terrain you would create each patch you generate as a 1x1 grid but also pass in a heightmap generated for each patch. Then inside the tessellation evaluation shader that's when the actual Y coordinates are mapped to each vertices that are created by the tessellation control shader. Then finally mapping it by scaling and translating it by whatever the world scale is (such as 64)?
@OGLDEV
@OGLDEV Месяц назад
You can create the grid from 1x1 squares (patches) and scale them up by the world scale in the vertex shader, OR, you can scale them already in the vertex buffer and save up one multiplication. You usually use one heightmap for the entire grid and not just for a single patch. As you said, we sample the height in the evaluation shader so basically the grid is flat in the vertex buffer. I guess you can also scale it in the TES but I haven't tried that.
@daveyhu
@daveyhu 2 месяца назад
Thank you ever so much for this!
@OGLDEV
@OGLDEV 2 месяца назад
My pleasure!
@Jpres
@Jpres 3 месяца назад
As soon as I look into tessellation he releases this. Thank you ❤This is good stuff
@OGLDEV
@OGLDEV 3 месяца назад
Hope you enjoy it!
@oraz.
@oraz. 3 месяца назад
This huge knowledge Ty.
@OGLDEV
@OGLDEV 3 месяца назад
Thanks!
@GomerSimpson-scratch
@GomerSimpson-scratch 3 месяца назад
What plugin do you use to highlight the code in the shader file?
@OGLDEV
@OGLDEV 3 месяца назад
I'm not at home right now but IIRC it's this one: marketplace.visualstudio.com/items?itemName=DanielScherzer.GLSL2022
@GomerSimpson-scratch
@GomerSimpson-scratch 3 месяца назад
@@OGLDEV Thanks so much, I'll give it a try!
Далее
Physically Based Rendering // OpenGL Tutorial #43
17:31
Crossing the Most Dangerous Crosswalk
00:24
Просмотров 10 млн
The U-Net (actually) explained in 10 minutes
10:31
Просмотров 90 тыс.
Introduction To Tessellation // OpenGL Tutorial #47
16:57
Let's Get Physical (Device) // Vulkan For Beginners #5
17:36
Introduction to shaders: Learn the basics!
34:50
Просмотров 304 тыс.
Introduction | GPU Programming | Episode 0
3:56
Просмотров 2,2 тыс.
Optimize Your Meshes! // OpenGL Tutorial #48
19:41
Просмотров 5 тыс.
Interactive Graphics 18 - Tessellation Shaders
1:01:29
Просмотров 14 тыс.
Why you should never use deferred shading
30:14
Просмотров 12 тыс.
Buffer Those Commands! // Vulkan For Beginners #8
13:03