Vertex Attribute Interpolation // OpenGL Tutorial #9

Опубликовано: 27 Июль 2026
на канале: OGLDEV
10,476
310

In this video we will study how the rasterizer interpolates vertex attributes that have different values in each vertex of the triangle (e.g. color). Spoiler: it uses Barycentric Coordinates so we will see how these work.

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

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

Visual Studio solution: ogldev/Windows/ogldev_vs_2022/ogldev_vs_2022.sln

The code for this tutorial is based on the Scaling tutorial. If you are not familiar with the code make sure you watch this first:    • Scaling Transformation  // OpenGL Tutorial #8  

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

🔥 See the list of the books that I'm using as background information for my tutorials: https://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:18 Background
1:54 Interpolating between two points
3:42 Interpolating in the triangle
4:34 Barycentric coordinates
5:29 Using barycentric coordinates for interpolation
6:14 Calculating barycentric coordinates
7:23 Interpolation in the OpenGL spec
8:06 Code review
13:00 Conclusion

Feel free to comment below.

** Contact me:
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: "Sunny" from https://bensound.com
Ladder image: Hand vector created by upklyak - https://www.freepik.com/vectors/hand

Enjoy,

Etay Meiri

#opengl #ogldev #opengtutorials