I am working on a 3D renderer, and as I was loading various test models, I noticed that everything looked OK, except for the fact the the textures were all flipped on the x-axis.
This is actually previewed as I'm blitting my GBuffer to the screen, so it can't be a FBO-rendering problem.
After I load each .obj file, I prepare its VBOs. Here's the snippet setting up the texture coordinates:
for(Face f : master.faces) {
for(int i = pointsPerFace - 1; i >= 0; i--) {
uv[0] = f.texCoords[i].x;
uv[1] = f.texCoords[i].y;
texcoords.append(uv);
}
}
Things like replacing a coordinate with 1 - coordinate
don't really work, since that would flip the whole bitmap, not just the current triangle.
What could cause everything to be rendering x-flipped?