OpenGL Tutorial 12 - Mesh Class

preview_player
Показать описание
In this tutorial I'll show you how to make a Mesh class that will encapsulate all the other classes we've made till now in a nice little package.

*Source Code*

*OpenGL Documentation*

*Discord Server*

*Patreon*

*Timestamps*
0:00 Introduction
0:13 Mesh Definition
0:28 Mesh Class Header
1:25 Modify the VBO Class
2:33 Modify the EBO Class
2:43 Mesh Constructor
3:08 Rearrange Shader Layouts
3:37 Mesh Draw Function I
4:18 Modify the Texture Class
4:49 Mesh Draw Function II
5:21 Modify the Uniforms
6:33 Ending & Comments

*References*

#opengl #opengltutorial #computergraphics #cpp #visualstudio
Рекомендации по теме
Комментарии
Автор

This is a much underrated OpenGL series! You provide so much content is very short videos. Everything is on point, fast forward coding and still much teaching quality. Highly appreciated that you give access to the source code! You deserve way more views and likes!

Fabian-jwih
Автор

One tip for the future after you have completed the whole series put all the videos into 1 long video and name it something like OpenGL from beginner to advanced and share it everywhere. Because it's a longer video youtube will recommend it more and I also think more people will click on it because it's more convenient to watch 1 long video than a full series of videos.

TheSgrizli
Автор

you know, the scariest thing as a programmer is when we have to change loads of codes with little to no testing in between. Since we have no idea whether we made a bug or not, our only option is to close our eyes and run as fast as possible hoping that we didn't make a mistake, because that could take hours if not days to find. But once in a while we make no mistakes, and today, god blessed me!

silvertakana
Автор

Thanks for the helpful video! FYI - in the default.vert file in your source code, the layout is wrong. The colors and normals are swapped. I noticed cause I'm still using the pyramid, and when I rotated it around, the lighting looked weird/incorrect. I finally tracked it down to this. Once I swapped them, I was golden again.

brianrosenlof
Автор

isn't using sizeof for struct is dangerous since there might be struct padding?

lambdacalculus
Автор

Such an awesome content!! I watched all.. Can you make a simple 3D game, taking all these concepts please? I am more interested to learn how to design maps and move objects, including 3d collision detection.

dapoint
Автор

Hey, great tutorial series! Been enjoying watching and learning along, but I've encountered a weird bug. I've done as much debugging as possible, and when that did not work I used the 1/1 copy of your source code and the same issue persists. In the Mesh.cpp class when providing the stride for LinkAttribute (where you were doing sizeof(Vertex)), for some reason doing sizeof(Vertex) causes the mesh to not render at all. I'm not entirely sure what the stride in the LinkAttribute is supposed to represent, but I managed to get everything but the textures working 1:1 by providing different sizes instead. Any idea how I could attempt to fix this?

shiiroitori
Автор

what happened to the texture.bind() in while loop and also deleting all the buffers after while loop in main file

babdie
Автор

Hi! Great video, as always! I came across a problem while forming the executable, the VAO instancing in Mesh.h would not be accepted and would always pop up an error. A quick and easy fix is renaming the VAO instance to something else (personally I chose "VAOi") and replacing all the VAO functions in the Mesh.cpp file with the new name/occurence of the VAO instance (for example, instead of VAO.Bind(...) you should now have VAOi.Bind(...))

alexchatzi
Автор

how does the light mesh work when ur linking multiple attributes in the mesh class, how does it not use the light vertices as normals, colors and tex since that's not changed?

post_rot
Автор

when i ran the program, no geometry was shown. no compiler errors or exeptions jsut the bg color.

icantplay
Автор

Hi, so next I finished the tutorial I noticed that textures isn't working correct. It's just black, it didn't work. So I putted all your codes from the source code and still the same and light doesn't work on it. Any idea about fixing that?

mlazy
Автор

Hi Victor! This is so underrated! Thanks for all you do!
I'm trying to make a simple 3d modeling application. Can you advice some videos or articles about more complex data structures for storing meshes? For instance I want to be able to pick polygons, points, and edges using quad tree. How to manage meshes when you want to delete or add points and polygons for example you want to extrude or bevel. Should it be done on CPU code side, or it can be done via "changing" Buffers on a fly? How to properly store mesh in those cases? Thank you so much anyway!

PashaHomenko
Автор

bad rule use null-terminated string for equitable purpose. why not used enum?

redpollsgarbagecollection
Автор

Do you really need to use string comparison and string concatenation in a Mesh.Draw function that is being called each frame? That looks like a huge vaste of computational energy, shouldn't it be done with enums?

shaperones
Автор

Hi, after finishing your tutorials up until now I noticed an odd behavior in my code. I created a cube, just like you did via hard coding. But when i spun the cube with the glm::rotate funktions the texture that was previously on the shadow side, kept in shadow, not changing even was in bright light. Dose that has something to do with the light even tough I am still passing in the same old position?
Love you and thanks.

jedder
Автор

The number of textures is now limited to the number of uniforms written in the shader, right? So if you have just diffuse0 and specular0 you can only use 2 textures. Would be great to see a video making everything dynamic or some of them.

starklosch
Автор

Hi Victor, a brilliant video as always and my code is now a LOT easier to read, thanks! I've got one issue that's puzzling me now though. I'm rotating a cylinder mesh when a key is pressed (which works), but the light cast onto it doesn't update during the rotation. One part of it is constantly illuminated and the rest is dark. Probably something really simple, but pulling my hair out :-D Any ideas please?

gavgonacrt
Автор

What should I press in order to rotate the model and to spin around the shape with the camera?
In line 106 in main.cpp when I change GL_RED to GL_RGB it throws an exception. Why?

kabrailchamoun
Автор

does this work with skeletal meshes?
this and the model loading one

Theawesomeking