[Victor Gordan] OpenGL Tutorial 14 - Depth Buffer

🎯 Загружено автоматически через бота: 🛑 Оригинал: 📺 Victor Gordan — @VictorGordan 📃 Оригинальное описание: 👍 262 👎 0 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦 Last updated on 27/Jan/2023 at 13:41 UTC In this tutorial I'll show you how the Depth Buffer in OpenGL works and how we can change it to create different simple effects. NOTE: If you are having trouble loading in the models in this tutorial, it might be because the names of the textures are “diffuse“ and “specular“ instead of “baseColor“ and “metallicRoughness“ like in the previous tutorial. To fix this simply make the 'getTextures' function accept “baseColor“ or “diffuse“ and “metallicRoughness“ or “specular“ like this: if ((“baseColor“) != std::string::npos || (“diffuse“) != std::string::npos) else if ((“metallicRoughness“) != std::string::npos || (“specular“) != std::string::npos) Also note that in the Vertex Shader I removed the negative sign from the rotation matrix! -— Source Code & Models —- -— OpenGL Documentation —- -— Discord Server —- -— Patreon —- -— Timestamps--- 0:00 Introduction 0:16 Depth Buffer Explanation 0:49 glDepthFunc Options 1:15 Viewing the Depth Buffer 1:37 Depth Value Function 2:08 Linearizing Depth Function 2:19 Viewing Linear Depth 2:43 Z-fighting 3:38 Fog Effect 4:30 Ending -— References —- #opengl #opengltutorial #computergraphics #cpp #visualstudio