Closed David-DiGioia closed 3 years ago
In the section "Texture mapping > Combined image sampler" the code snippet where we add texture coordinates is
const std::vector<Vertex> vertices = { {{-0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f}}, {{0.5f, -0.5f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f}}, {{0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {1.0f, 1.0f}}, {{-0.5f, 0.5f}, {1.0f, 1.0f, 1.0f}, {0.0f, 1.0f}} };
But in the full code for this section it is
const std::vector<Vertex> vertices = { {{-0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}, {1.0f, 0.0f}}, {{0.5f, -0.5f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f}}, {{0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}, {0.0f, 1.0f}}, {{-0.5f, 0.5f}, {1.0f, 1.0f, 1.0f}, {1.0f, 1.0f}} };
Notice the difference in texture coordinates. One is the mirror image of the other. The images in the tutorial disagree with the first code snippet and agree with the second, which can cause some confusion when you're following along.
Thanks for spotting that, I've fixed it!
In the section "Texture mapping > Combined image sampler" the code snippet where we add texture coordinates is
But in the full code for this section it is
Notice the difference in texture coordinates. One is the mirror image of the other. The images in the tutorial disagree with the first code snippet and agree with the second, which can cause some confusion when you're following along.