Basic Texture Mapping // OpenGL Tutorial #16

Опубликовано: 13 Март 2025
на канале: OGLDEV
39,197
589

AEJuice Free Plugins https://aejuice.com/free-plugins/?ref...
AEJuice I Want It All Bundle https://aejuice.com/product/i-want-it...
AEJuice YouTube Channel    / @aejuice  

In this video we will go over the details of getting basic texture mapping working in OpenGL using C++.

🔥 I'm using the following books as background information for my tutorials and I highly recommend them for learning more about OpenGL and Vulkan.
These are affiliate links so if you use them to buy the books the price is the same for you and I will get a small commision (thank-you!).

📖 OpenGL 4 Shading Language Cookbook - Third Edition: Build high-quality, real-time 3D graphics with OpenGL 4.6, GLSL 4.6 and C++17 3rd ed. Edition: https://amzn.to/3XO2J3S

📖 3D Graphics Rendering Cookbook: A comprehensive guide to exploring rendering algorithms in modern OpenGL and Vulkan: https://amzn.to/3MMJQbf
(Watch my short video review on this book:    • The 2nd book I'm using for my Vulkan ...  )

📖 Vulkan Programming Guide: The Official Guide to Learning Vulkan: https://amzn.to/3XwBjhr
(Watch my short video review on this book:    • The book I'm using for my Vulkan seri...  )

Make sure to watch all the previous tutorials in the "OpenGL For Beginners" playlist at    • OpenGL for Beginners  

Please visit https://ogldev.org to see more of my tutorials on modern OpenGL.

Link to source: https://github.com/emeiri/ogldev/blob...
If you want to get the same version that was used in the video checkout the tag TUT_16_TEX_MAP.

OpenGL 4.6 specification: https://www.khronos.org/registry/Open...

Get the STB image header: https://github.com/nothings/stb/blob/...

Timecodes:
0:00 Intro
0:40 Challenges
1:02 Texture coordinates
2:00 Number of texture axes
2:32 Naming the texture axes
2:58 Minification and magnification
4:53 Filter types
6:08 Texture mapping arch in OpenGL
8:28 Texture mapping TODO list
10:34 Star of code review
10:37 Getting STB image
12:18 The Texture class
13:44 Loading the texture
17:22 Setting texture state
18:11 The bind function of the texture class
18:36 Shader changes
19:42 Handling texture coordinates
20:17 Misc changes to app code
20:55 Changes to the render loop
21:28 Build and run
21:34 Conclusion

Feel free to comment below.

Email: [email protected]
Facebook:   / ogldev-188319114585587  
Github: https://github.com/emeiri/ogldev.git
Twitter: @ogldev
One time donations (Paypal): https://ogldev.org/donate.html
Patreon:   / ogldev  

Credits:
Music: "Smile" from https://bensound.com
Images:
http://wiki.polycount.com/w/images/7/...
https://opengameart.org/node/31073
https://docs.blender.org/manual/en/la...
https://opengameart.org/sites/default...
https://upload.wikimedia.org/wikipedi...
https://wallpaperaccess.com/pixar-logo
https://commons.wikimedia.org/wiki/Fi...
https://en.wikipedia.org/wiki/Edwin_C...
http://static1.1.sqspcdn.com/static/f...

Enjoy,

Etay Meiri

#opengl #ogldev #opengtutorials