- Видео 107
- Просмотров 932 570
OGLDEV
Добавлен 10 ноя 2020
Creating video tutorials on modern OpenGL and Vulkan using C++ on Windows and Linux.
Check out my website for more tutorials: ogldev.org.
🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!).
🙏If you like my channel please consider supporting it:
🔹Patreon - www.patreon.com/ogldev
🔹By joining the RUclips channel as a member
🔹A one time donation will also be highly appreciated: ogldev.org/donate.html
Check out my website for more tutorials: ogldev.org.
🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!).
🙏If you like my channel please consider supporting it:
🔹Patreon - www.patreon.com/ogldev
🔹By joining the RUclips channel as a member
🔹A one time donation will also be highly appreciated: ogldev.org/donate.html
Uniform Buffers // Vulkan For Beginners #17
In this video we learn how to create uniform buffers in Vulkan and bind them to the graphics pipeline object. We also learn how to integrate a 3D camera into the application.
🔥More details on the 3D camera: ruclips.net/video/KEKcDvS3hDQ/видео.html
🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!).
📚 Timecodes 📚
0:00 Intro
0:39 Changes to the vertex shader
3:06 Changes to the application code
4:26 Creating a uniform buffer
7:21 B...
🔥More details on the 3D camera: ruclips.net/video/KEKcDvS3hDQ/видео.html
🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!).
📚 Timecodes 📚
0:00 Intro
0:39 Changes to the vertex shader
3:06 Changes to the application code
4:26 Creating a uniform buffer
7:21 B...
Просмотров: 759
Видео
Create your own Cubemap // Intermediate OpenGL Series
Просмотров 2,3 тыс.21 день назад
🔥To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/OGLDEV/ . You’ll also get 20% off an annual premium subscription. In this video we learn how to convert an Equirectangular Image to a cubemap in OpenGL. The result can then be used for Skybox rendering. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.htm...
Descriptor Sets // Vulkan For Beginners #16
Просмотров 1 тыс.Месяц назад
In this video we learn how to connect a vertex buffer to the graphics pipeline object using a descriptor set and descriptor set layout. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is th...
Vertex Buffers // Vulkan For Beginners #15
Просмотров 1,4 тыс.Месяц назад
🔥To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/OGLDEV/ . You’ll also get 20% off an annual premium subscription. In this video we learn how to create vertex buffers in Vulkan. 🔥How to install GLM: ruclips.net/video/KEKcDvS3hDQ/видео.html 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly ...
3D Camera - a GLM Story
Просмотров 2,2 тыс.2 месяца назад
In this video we learn how to create a 3D camera using the GLM library. This camera can be used for both OpenGL and Vulkan. 📚 Timecodes 📚 0:00 Intro 1:18 Background 3:04 Installing GLM 4:46 The camera class 7:16 Matrix/quaternion initialization 8:24 The view matrix 9:53 The perspective projection matrix 10:17 Camera class integration 11:23 Keyboard control 16:10 Calculating the velocity and acc...
Graphics Pipeline Object // Vulkan For Beginner #14
Просмотров 1,9 тыс.2 месяца назад
In this video we will render our first triangle! This will made possible using the Graphics Pipeline Object which will be bound to the command buffer. It will provide all the state required by the draw command (also added in this video). 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about O...
The Endless Grid
Просмотров 4,4 тыс.3 месяца назад
In this video we learn how to create an infinite grid using OpenGL. It is based on an article from the '3D Graphics Rendering Cookbook' (see link below). 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the boo...
Shaders // Vulkan For Beginners #13
Просмотров 2,3 тыс.4 месяца назад
In this video we learn how to create the vertex and fragment shader for our first Vulkan demo. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small com...
Programmable Vertex Pulling // Intermediate OpenGL Series
Просмотров 3,1 тыс.4 месяца назад
In this video we learn how to get vertices into the vertex shader using the Programmable Vertex Pulling technique. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I ...
Pass me that render, please // Vulkan For Beginners #12
Просмотров 3,9 тыс.5 месяцев назад
In this video we learn how to use the Render Pass and Framebuffer objects. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!)...
Normal Mapping Adventures // OpenGL Intermediate Series
Просмотров 2,7 тыс.5 месяцев назад
In this video we learn how to implement normal mapping, also known as bump mapping. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (th...
Image Memory Barriers // Vulkan For Beginners #11
Просмотров 2 тыс.6 месяцев назад
In this video we learn how to use Image Memory Barriers in order to transition the layout of the images in the swap chain. This fixes the errors that we saw in the previous tutorial. 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you u...
Submitting Command Buffers // Vulkan For Beginners #10
Просмотров 2 тыс.6 месяцев назад
In this video we learn how to submit command buffers into a Vulkan queue. This will get us the first visual response in Vulkan - the window will finally be cleared... 🔥 See the list of the books that I'm using as background information for my tutorials: ogldev.org/books.html. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy a...
Recording the clear command // Vulkan For Beginners #9
Просмотров 1,8 тыс.7 месяцев назад
Recording the clear command // Vulkan For Beginners #9
Buffer Those Commands! // Vulkan For Beginners #8
Просмотров 2,7 тыс.8 месяцев назад
Buffer Those Commands! // Vulkan For Beginners #8
Terrain Tessellation Shaders // Terrain Rendering Episode 13
Просмотров 3,9 тыс.8 месяцев назад
Terrain Tessellation Shaders // Terrain Rendering Episode 13
DJ! Swap that chain!!! // Vulkan For Beginners #7
Просмотров 2,9 тыс.9 месяцев назад
DJ! Swap that chain!!! // Vulkan For Beginners #7
It is illogical (device) // Vulkan For Beginners #6
Просмотров 1,9 тыс.9 месяцев назад
It is illogical (device) // Vulkan For Beginners #6
Let's Get Physical (Device) // Vulkan For Beginners #5
Просмотров 2,8 тыс.10 месяцев назад
Let's Get Physical (Device) // Vulkan For Beginners #5
Creating a Surface Handle // Vulkan For Beginners #4
Просмотров 2,7 тыс.10 месяцев назад
Creating a Surface Handle // Vulkan For Beginners #4
Creating a Debug Callback Function // Vulkan For Beginners #3
Просмотров 3,1 тыс.10 месяцев назад
Creating a Debug Callback Function // Vulkan For Beginners #3
Creating an Instance // Vulkan For Beginners #2
Просмотров 7 тыс.11 месяцев назад
Creating an Instance // Vulkan For Beginners #2
Quad Tessellation // OpenGL Tutorial #51
Просмотров 3,6 тыс.Год назад
Quad Tessellation // OpenGL Tutorial #51
Direct State Access // OpenGL Tutorial #50
Просмотров 5 тыс.Год назад
Direct State Access // OpenGL Tutorial #50
Render a Wireframe On a Solid Mesh // OpenGL Tutorial #49
Просмотров 4,4 тыс.Год назад
Render a Wireframe On a Solid Mesh // OpenGL Tutorial #49
Optimize Your Meshes! // OpenGL Tutorial #48
Просмотров 7 тыс.Год назад
Optimize Your Meshes! // OpenGL Tutorial #48
Introduction To Tessellation // OpenGL Tutorial #47
Просмотров 7 тыс.Год назад
Introduction To Tessellation // OpenGL Tutorial #47
Text Rendering In OpenGL // OpenGL Tutorial #46.2
Просмотров 5 тыс.Год назад
Text Rendering In OpenGL // OpenGL Tutorial #46.2
3D programming is really a tough subject, I thank you for your efforts to make it more accessible... In the days of the playstation 1, there were no shaders. I wonder how a game like crash bandicoot 3 could be programmed, for example (even GTA 3 and the games that use the same engine don't use shaders).
You're welcome! Graphics existed before the programmable pipeline. In the case of OpenGL there was the deprecated pipeline with an API which supported a very specific type of lighting model, fog, etc. Before that sw rasterization was the way to go (Doom, Quake, etc). I'm not an expert on the PS1 but from what I know it had a GPU which provided various rendering effects which allowed you to program very close to the HW. I imagine it was similar to the idea of the deprecated GL pipeline even though the API was probably somewhat different.
Amazing guide for beginners that complements very well with the LearnOpenGL website, i come to these videos after figuring it out for myself with the website to see if my learning is correct, comparing what i understood reading with the explanations in the videos, thanks
Glad it was helpful!
At 18:32, why use the xy attribute of TexCoord0 (what's that anyway?) instead of TexCoord0
Texture coordinates are explained in tutorial #16 (texture mapping). Since TexCoord0 is a vec2 then it is indeed equivalent to TexCoord0.xy. I guess I was a bit explicit here.
I would actually say EGL is multi-platform. It's more dominate on Linux than GLX and works on Windows too.
Simply use GLFW... ;-)
@@OGLDEV No doubt that is simpler. But I prefer to code what I'm able. GLFW is nice but it does a lot I don't need. I don't find creating a window or handling input prohibitively difficult in Linux or Windows. I will say importing all the GL functions manually is pretty unpleasant though. So I am currently using GLAD. At least until I figure out what I need and don't. It's amazing how much simpler OGL is compared to Vulkan. Way nicer to just try stuff out and experiment with.
I usually go with simpler if it works out of the box and coding it myself does not provide an actual benefit. That's why I use GLFW, GLEW, Assimp and STB. I coded my own math functions for the tutorials in order to explain 3D math but on a real project I wouldn't mind using GLM.
@@OGLDEV That's reasonable. It's personal preference.
Sure
Hi Friend! thanks for your videos, love them! One question how different is this approach compared with your terrain series? I have not started to see that series.
You're welcome! The endless grid technique doesn't deal with height generation. It uses the distance from the camera to generate a dynamic grid on a flat square. So it's not equivalent to any terrain rendering algorithm.
@@OGLDEV Thanks for your explanation, now I understand. and what is de purpose to have and endless grid?
Visual debugging, and for implementing a dynamic grid for stuff like Blender, Unity, etc.
1:18 leukemia caused by agent orange spraying in vietnam
Wow, I didn't know that. So tragic. Such a loss.
What kind of performance increase you got when rendering with Frustum Culling?
I haven't measured myself but since this is such a popular technique I assume that there is an increase in performance. Note that the improvement highly depends on the size of the workload and the amount of pressure it puts on the GPU as well as the specifications of the machine. So for each use case you will get a different result.
@OGLDEV completely agree with the answer.
Thanks :-)
I'm not a simp so I will not use Assimp 😂On Windows, you can use vcpkg to install 3rd party libraries, it has integration with Visual Studio so you will not need to configure the VS compiler and linker. It also supports CMake. At 19:00, At 19:00, why did you check for a backslash, a Windows separator not used under *nix operating systems?
np...
At 8:14 don't you have to compile the shaders before creating the OGL objects ?
Shader programs and OGL objects are orthogonal in terms of initialization. You just need to make sure by the time you call glDraw* that everything is initialized and bound.
You don't need to send the texture unit ID if you're using a single texture.
You mean the sampler ID that goes to the shader? I'm assuming that in a real world app you will be switching multiple textures so I show all the steps even if something is done by default.
Could you please help me understand pi 5 Vulkan compatibility and how to create h264 codecs into it for hwaccels in ffmpeg? Or without idk
Sorry, I'm not familiar with h264 in Vulkan.
Thanks for your tutorials! The order of transformation and what they should be is quite confusing though. I took some notes: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // the transformation of coordinate spaces for a skeletal mesh should happen in this order (left-to-right - D3D): nodeTransformationMatrix = scaling * rotation * translation; // scaling, rotation, translation take from this Node's aiNodeAnim structure for a specific animationTick; interpolation between the 2 keyframes between the input animationTick should also happen here (omitted for readability) finalNodeTransformationMatrix = rootNodeTransformationMatrix * ... * parentNodeTransformationMatrix * nodeTransformationMatrix; // the Node the specified Bone belongs to globalInverseTransform = inverse(rootNode->mTransformationMatrix); // a single matrix per Model (for all Nodes in said Model) finalBoneMatrix = boneOffsetMatrix * finalNodeTransformationMatrix * globalInverseTransform; // passed to vertex Shader finalVertexLocalSpace = vertexLocalSpace * finalBoneMatrix; // computed in vertex shader for a specific animation key // continue with transforming finalVertexLocalSpace with the WVP matrix etc.. Note: * If this is a Skeletal Mesh, then mTransformationMatrix isn't used at all (except for the root's) and instead the aiNodeAnim's combined transformation is used instead. * If this isn't a Skeletal Mesh, then nodeTransformationMatrix = mTransformationMatrix. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Is this right (in pseudocode), or nah? Could you give me a verification please? (pay attention to the order, I'm using left-right d3d so opposite to your OpenGL one). Thanks all the same! :)
Looks correct.
@@OGLDEV Thanks, your tut cleared up lots of things. Probably the clearest and most complete programming tutorial of skel animation I've seen online. Cheers!
Thanks!
Does it work differently in vulkan ? I guess I will have to want until the series finishes, because it is an advanced topic.
It's actually not that advanced. I'm using the "3D Graphics Rendering Cookbook" as a guide for this series and this topic comes after textures and a few renderer restructuring.
I started my channel 5 days ago 😅. Wish me good luck pls ❤
Good luck! You've got a new sub!
@@OGLDEV thanks so much. I think my channel is doing well 🥳
What is best choice for frame rendering On render each frame: Begin command buffer Begin pass Bind set 0 camera uniform buffer For each sub mesh of each mesh bind it's material set 1 And vertex buffer and render base vertex for each submesh Send pass This pass render to color attachment And then do begin single screen quad pass for post processing and end pass Then one submit of all these Or each pass has its own command buffers and successive submits Successive submits get me errors with semaphores even with using frames in flight
Great video! Just subscribed!
Thanks! Welcome aboard!
How many sprites were you able to render like that at 60fps or so? Would be interesting to know, plus your pc specs.
I haven't tested the perf limits of that implementation. If you plan to render lots of sprites simply make sure that you have a large enough vertex buffer so that you can render all of them in one draw call and then you'll be fine. My PC specs: Core-i9, GTX1650, 16GB ram.
Looks like the debug messages or the validation don't work in Vulkan 1.3.296. They may have changed some things, as I don't have any output for the Debug even when I make sure to have errors it should catch, such as not destroying things before terminating. Any idea what to do to get a debug logger like this in newer versions?
I don't know about 1.3.296. I'm using 1.3.290 and they work fine. Maybe try to downgrade. Is there a previous verison where you know they were working?
@@OGLDEV Turned out to be user error, or the debugger wouldn't report the instance not being destroyed. And it wouldn't report anything missing unless something first has been made, such as a physical device not being destroyed correctly.
Great!
I love these videos! Especially when you show with visual using boxes and arrows how things are dependent on each other. Vulkan feels like a mess (for me) just starting out. And a lot of times I wonder why do some things even exist. But this playlist really clear things up ♥
Thanks!
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 'VULKAN_17'. Build on Windows: Open the Visual Studio solution: ogldev\Windows\ogldev_vs_2022\ogldev_vs_2022.sln Build the project 'Vulkan\Tutorials\Tutorial17' Build on Linux: cd Vulkan/Tutorials/Tutorial17 ./build.sh
thks for help
Always welcome :-)
Very nice video ! Greetings from Tunisia.
Thank you so much!
OGLDev you have the best graphics programming videos. I love the humor XD
Glad you enjoy it! 😁
Nice video! I have a question, in the 2nd method, the notation of dot_product(p_view, row1 - row4) for example, shouldn't be like this: dot_product(p_world, row1 - row4), because we are using the point in World Space? That is, otherwise, we should have multiplied by ViewMatrix in p4D (and that's not correct, obviously). If I'm wrong, please correct me, maybe there's something I'm misunderstanding. Thanks!
The original condition was -Wc<=Xc<=Wc. To calculate Xc we apply the projection matrix on the view space vector. Otherwise moving the camera will have no effect. So we have to use p_view and not p_world on all the calculations. This is just to show the transformations that the position has to go through. To avoid transforming p4d to view space (as we do in the first method) we calculate the clip planes based on the view-projection matrix. This is why it is more optimized.
@@OGLDEV Thank you for the quick answer! Sorry again, so: The idea is not avoiding multiplying vertex by a matrix each frame? In fact, in 10:10 (method 1) you do that, and 18:20 (method 2) you don't do that. Method 1: p4D = VP * vec4(p, 1.0) Method 2: p4D = vec4(p, 1.0) Method 1: Inside = p4D.x <= p4D.w && p4D.x >= -p4D.w && ... Method 2: Inside = dot(leftClipPlane, p4D) >= 0 && dot(rightClipPlane, p4D) <=0 && ... So p4D (in method 2) is in World Space (you didn't multiply it by any Matrix). That's why I mean that must be 'p_world' and not 'p_view', because you never multiplied 'p' by any matrix before. (assuming 'p' in World Space, and not in Local Space obviously). Also, your Update of Frustum Planes take ViewProjectionMatrix as parameter: void Update(const Matrix4f& ViewProj) { ViewProj.CalcClipPlanes(m_leftClipPlane, ...); } Anyway, I understand that the proof in method 2 is correct, and the dot_product(p_view, row1 - row4) is fine, because row1 and row4 come from a ProjMatrix transformation (and not ViewProjMatrix). But the question is in contrast to the code. Thanks again!
Yes, the idea is to optimize away the matrix multiplication. But if what bothers you is the slide in 21:43 then at this point we are looking at the naive method of going from view to clip space. And then we incorporate that knowledge into the calculation of the clip planes so we don't need to do the matrix multiplication. So the slide doesn't indicate what the code is doing, just the rational of how we get there.
super simple now just include vcpkg with manifest mode and a vcpkg.config and it'll download whatever you want automatically any os
I'll check it out. Thanks for the tip.
@@OGLDEV in AlmondEngine it's setup with msvc and also completely seperately with CMake, so it could be working within minutes.. microsoft has a tutorial on how to set it up, and in CMake just include the "include and share" directories, the triplet is automatic to the OS and system eg x64... on linux I had to install libs in classic mode before cmake could copy them over, but you can uninstall once they do.. it creates a vcpkg in your project directory and when you remove items and build it'll uninstall them also. it builds and copies the dll, libs, at runtime into the bin folder also, It's the only way to code now.
@@OGLDEV Search vcpkg manifest mode tutorial
@@OGLDEV there are other package managers as well eg Conan
@@OGLDEV ruclips.net/video/0h1lC3QHLHU/видео.html
Great video! Thank you 🙏
You're welcome!
I was searching for VULKAN from warhammer 40K 😂
Now you found it!
I think it's a good thing to use glBindBuffer(GL_ARRAY_BUFFER, 0) after using a VBO
True, same for VAO.
I've been stuck on a problem for a while - shadows rotate together with objects, i understand that it's a math error, but i can't find it. Anyone has any idea where to look at? Btw, great video, thanks for your detailed explanations! The course is really useful for learning graphics programming in general, not just opengl.
You're welcome! Do you mean that when the camera is moving and the light doesn't the shadows move instead of being stationary?
@OGLDEV thanks for the reply!) No, when the light is stationary, and the camera rotates, everything works fine, but when the object itself is rotated, the lit area on it, and the shadow rotate too, as if the light source has moved (which it didn't)
But if the object is rotated shouldn't it have an effect on the shadow? Unless the object is a sphere or something like that. If the light doesn't move the shadow WVP matrix and the shadow map should look the same. You can easily print the matrix and verify. The shadow map can be viewed in RenderDoc.
@OGLDEV I mean, it rotates like it's stuck to the object, as if it was just a texture. Logging data is a problem cause I'm using webgpu, it's not that straightforward, which is part of the problem)
Probably a bug in the construction of the shadow matrix. I'm not familiar with webgpu but this page provides some details on debugging with RenderDoc: eliemichel.github.io/LearnWebGPU/appendices/debugging.html
i am still struggling with quaternions, but it actually fixed my issues with the camera - i previously used to just rotate cameraRight and cameraForward vectors around cameraUp or cameraRight, but somehow this time it was just wobbling camera in an oval (like if the forward vector was rotated using cosine function)
Quaternions are difficult to intuitively understand but afaik they are the best solution to all those camera rotation problems.
best opengl course seen so far
Thanks!
Another fun upload! Something neat of a rough benchmark test I found out that the 8k toned jpg file @ 6mg loaded about 2 seconds in equirectangular projection. I then took the same jpg file and cubemapped it into 6 separate files which blew up from 58mb to 73mb each to match the resolution and took 6 and a half seconds to load in cubemapping layout!
Thanks! So are you saying that it is actually better to run the algorithm in real time instead of using it as an offline tool to create a cubemap texture?
@@OGLDEV In the case of the 8k file yes! However, if the jpg file is 4k and lower the outcome may be different. Which I should've tested in advance I apologize.
Interesting, thanks.
@@OGLDEV another odd thing is I feel like the single jpg algorithm 'looks' better when looking up and down as opposed to the 6 file cubemap. However it could be all in my head.
Probably just a false impression. Since we are going through a cubemap texture anyway.
may i ask where u from your accent sound really familiar
קרית חיים
@@OGLDEV טוב לדעת שיש לנו אנשים כמוך במדינה. תודה רבה אחי על התוכן הנהדר 🙏
בכיף!
OpenGL cubemap coordinate space is horrid -- thanks for spending the time to break it down
You're welcome 😊
Merry Christmas dude. 🎅🏾
Merry Christmas! 🎄
@@OGLDEV I wish you a great year. 🍀🥳
Is OpenGL still worth learning in 2025?
Assuming that you are interested in learning a graphics API (because strictly for game development a game engine may be a better choice) then OpenGL is a good balance between low level and "developer friendly". Vulkan and D3D12 are very low level and move a lot of the driver work over to you. Theoretically it should provide performance improvement but you need to know what you're doing and how to optimize. OpenGL allows you to build almost any kind of renderer but the driver still takes care of a lot of stuff for you.
It must be incredibly hard and frustrating learning vulkan (or D3D12, Metal) if you don't have a previous knowledge of any Graphics API first. I think it's more human-friendly to learn OpenGL ES 1.1 to learn the basics, then OpenGL ES 3.0 and finally (and if your app/game has a cpu bottleneck) Vulkan. As far as I know OpenGL ES 3.0 has some advantages than OpenGL, it runs on Android and with ANGLE as a Renderer, it translates OGL calls to Vulkan, D3D and Metal
I recommend studying OpenGL before Vulkan. I'm not experienced with ES but I guess it should serve the same function of providing a 3D foundation as well as 3D math which will be useful for Vulkan as well.
Thanks for the video, very helpful. But you should really consider switching to the synchronization2 API since that's what most people who are learning Vulkan in 2024 will be using. Also TOP_OF_PIPE_BIT and BOTTOM_OF_PIPE_BIT are both deprecated. You can just use ALL_COMMANDS_BIT or NONE_BIT.
You're welcome! I'll probably do that later in the series. I'm following a book which came out prior to the new api but I'll find a spot for it.
I came up with this while trying to implement it myself, It works pretty well! I think this may be more efficent than what is shown in the video. void PerspectiveCamera::AddPitchInput(float offset) { m_Orientation = glm::normalize(glm::angleAxis(glm::radians(-offset), GetRight()) * m_Orientation); UpdateViewProjection(); } void PerspectiveCamera::AddYawInput(float offset) { m_Orientation = glm::normalize(glm::angleAxis(glm::radians(-offset), glm::vec3(0, 1, 0)) * m_Orientation); UpdateViewProjection(); } glm::vec3 PerspectiveCamera::GetRight() { return glm::normalize(m_Orientation * glm::vec3(1, 0, 0)); }
Thanks for the feedback. Why is this more efficient? You have separate functions for pitch and yaw so you call angleAxis twice.
@@OGLDEV The implementation in the video creates 2 quats as well one with the constructor that takes in a vector and one with the lookat function, I might be wrong but I thought my way could be more efficent because of the way I use quats to get the right vector and simply rotate around that.
The quaternion in the constructor is called only once so it doesn't really matter. I'm making the comparison with my CalcCameraOrientation() which creates a single quaternion from the change on both X and Y and multiplies it by the orientation matrix.
@@OGLDEV calcameraorientation by itself does not really work though, It calls SetUpVector which creates another quat.
True. This is to reset the orientation of the camera so that it doesn't tilt from side to side (supporting only yaw and pitch, avoiding rolling). Did you have this problem? How did you solve it?
Something I would like to do is playback a video using hardware decoding. If you could do a video on using FFMPEG to decode video frames into textures on the GPU using OpenGL that would be amazing.
Reminds me that I wanted to try pl_mpeg
I've added this to the todo list. I have to admit that I'm not familiar with this so will require some research to implement.
@@OGLDEV I understand. Unfortunately ffmpeg examples are pretty rare and most of them do not decode to video memory but rather to system memory and then copy back to the GPU which is very inefficient but simpler I guess. Thanks for looking into it.
Thanks!
Glad it was helpful! Thank you for your continued support 😊
To get 10 months of early access (per the "Officer in the 3D underground" tier on Patreon) just send me your email.
I personally prefer start with d3d11. Now I'm a big fan of Vulkan and D3D12.
I would love to make a D3D11 series. Unfortunately I don't have the time for it...
@11:51 Maybe it's this? R = sqrt(x^2+y^2+z^2). But the documentation takes the arctan from something other than R. It uses only sqrt(x^2+y^2).
Perhaps the usage of 'R' is a bad naming choice because it confuses with the Greek rho. The docs indeed do the square root without Z.
@@OGLDEV You're just picking the wrong lengths/ratios of the right-sided triangle when calculating the tangent of the angle. Tangent = opposite side / adjacent side. But you did hypotenuse / adjacent.. *And we all thought that the part @**9:42** was the confusing part.* 🙂 fun.. It really _is_ confusing with all the axis swapping and/or negating. It all looks the same, and it makes you simple. I had to do it too in a project, and i used a matrix to convert the values (looks cleaner?). But it didn't work the first time 😄 because of confusion(s) => mistakes.
sqrt(x^2+y^2) is the length of the projection of line on the XY plane. What I did is Z/sqrt(x^2+y^2) which is the arctan of (90-theta) instead of theta as it appears in the diagram. But I guess it makes sense because we get theta=0 on the XY plane (when Z is zero) and then v=0.5. When z=1 and sqrt(x^2+y^2)=0 we get theta=PI/2 and then v=0. When z=-1 and sqrt(x^2+y^2)=0 we get theta=-PI/2 and then v=1. So I was confused by then wikipedia diagram /equations which demonstrates the formal picture but for the cubemap case we should actually draw theta "below" the line rather than above it.
@@OGLDEV You debugged it afterall. ;-) In any case, this video is of good help for me. I am writing a little program to make a flat Earth. A friend wants to decorate a wall with a map of our planet, but without any distortion of distances (so, not using any of the usual map projections). Now i don't have to think so much anymore about how to tackle that problem in the calculations. 👍
Yes, your comment gave me the motivation. Good luck with the project!
Thanks for you content, I am not sure if you mentioned a very important step, 5:11, that WorldPos is an interpolation of the input WorldPos, the vertex shader output, it is mentioned in Tutorial #9, I think it's important to mention it here too.
You're welcome! Thanks for the feedback, hopefully at this stage people know that every input attribute in the fragment shader is the result of an interpolation of a vertex shader output variable.
i hope that u remember me......Its been a long while. I have learned a lot of openGL concepts in these months. Your tutorial helped me a lot. I now making my own 2d engine which is capable of producing output like commercial engine. I have learned a lot from a lot of RUclips channels. Your tutorial's are always detailed and explained with pictures which are easier to understand. Your work is well deserved. THANK YOU
Glad that the tutorials were helpful 😀
I have that book, it’s pretty cool but from what I know it’s pretty much just the vulkan spec, but in my case reading on paper is easier so I love the book.
I think it is a much nicer read than the spec. The spec is just like any other spec - contains all the details and makes it difficult to see the big picture. The book is more condensed and makes it easier to study a specific topic. I try to read the relevant chapter before every tutorial.
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/OGLDEV/ . You’ll also get 20% off an annual premium subscription. ****************************************************************************************** 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 'TUT_56_CUBEMAPS'. Build on Windows: Open the Visual Studio solution: ogldev\Windows\ogldev_vs_2022\ogldev_vs_2022.sln Build the project 'OpenGL\Tutorials\Tutorial56_Cubemaps'
Another great upload. But with all due respect, the title to this video tutorial should be Equirectangular Cubemapping!
Thanks! I think the original title will bring in more views... RUclips now allows you to experiment with multiple thumbnails and see which works best but you are still limited to a single title at a time. Maybe in the future I'll try a different title and see if it works better :-)
Hi, any tips on how to separate the land and water mesh of the heightmap? I would like to render them completely differently and I am not sure how to split the verts properly between the two.
Usually the heightmap doesn't include water. You decide the height of the water and then build a separate mesh for the water on top of the "ground".
Thanks! I was thinking of taking the same approach.@@OGLDEV
Great! You can see my water demo which is based on the tutorial by @ThinMatrix here: ruclips.net/user/shortsglBziimIN14?feature=share. See the vid description for the source. The water mesh in this case is just a rectangle but there are more advanced approaches.
we are getting errors on games with this one!
What errors exactly?
I love the tutorial and your voice. But how can I render shadows for multiple point lights in the scene? do I need to create multiple depth attachments or there is another efficient technique? I would be very glad if you create a video on it
Thanks! There are many approaches to handling shadows from multiple light sources. The basic method is indeed to create several textures and render into them. You can use the geometry shader to render into multiple textures instead of doing a multi-pass on the application level. You can use a texture array for holding multiple textures. I haven't done much optimization on this topic so I guess you'll need to do more research. The following contains interesting info on multiple shadows in Doom: www.adriancourreges.com/blog/2016/09/09/doom-2016-graphics-study/#shadow-map-atlas. I hope to cover this topic at some point...
@@OGLDEV thank you so much
Appreciate the hardwork. I was getting questions to why we need to add GLAD and GLFW and you solved it.Thank's man and you earned a sub
Thanks!