OpenGL [Episode 36] Mesh Abstraction Refactor Continued -- two quads
HTML-код
- Опубликовано: 11 сен 2024
- ►Full OpenGL Series Playlist: • Introduction to OpenGL
►Find full courses on: courses.mshah.io/
►Join as member to get perks: / @mikeshah
►Lesson Description: In this lesson I continue the refactoring and we end up ultimately with two quads! I opt for a 'C style' API for creating meshes and discuss a few of those trade-offs. I would encourage folks to otherwise consider an RAII style if they otherwise are comfortable with that style. I also go bug hunting a bit in this lesson, showing the issue of how you have to update your uniforms (the read only values) for the object that you want to draw prior to drawing -- do keep that in mind! There will be more abstraction later on in the series. As always, feel free to join the discussion!
►Please like and subscribe to help the channel!
►RUclips Channel: / mikeshah
►Join our free community: courses.mshah....
my understanding, if you want to add normals to the mesh (to make lighting for example) and want to have minute control of them (e.g. to have sharp edges sometimes), you basically have to skip the indexed buffer and pass each vertex multiple times: once per facet. You could calculate the normals with geometry shader. But everyone on the internet seems to recommend to just pass a large vertex array, with duplicated vertices. The internet says it is typically faster, it uses more memory but that's not a big concern, and you can have 3 different normals per a triangle, instead of only 1 per vertex with indexing or 1 per triangle calculated by the geometry shader. With 3 different normals, the fragment shader should be able to interpolate them and create an impression of a bent surface.
Indeed, that is correct! Because say a corner of a cube for example, each vertex will be a part of 3 faces, thus need 3 unique normals for each face. Many tools will otherwise give the option to 'average vertex normals' and just emit one normal per-vertex, but it just depends on what type of lighting you need.
A much clearer approach to the matrix multiplications needed to place objects than other basic tutorial courses which the waters by adding the camera class after the fact. I'm looking forward to an explanation of modelling a hierarchy of objects with cumulative modelling transformations which the other tutorials only hint at.
@@duncangibson6277 that's where we're heading 😁
Great lesson. Thanks!
@@TimHaga cheers!
This is the most w sigma opengl series 🔥
Define aura : mike shah 🔥✌️
Cheers!
thinks for the goode video tutorail
Cheers!
Do you use LSP for navigate code in project?
For larger projects I do
why don't u use smart pointers
It's an attempt to manage the 'noise' in learning the graphics API. Many folks are also following along this series in other languages that do not use unique_ptr 🙂Perhaps towards end of series I will do a larger refactoring to modernize the code.