Hi everyone, I’m having a little trouble getting my texture to apply to my model correctly… I’ve created a basic 2d texture… Here is my basic texture creation scheme
My model is loading fine when I go into my fragment shader and just set the fragment output to black the model is complete and looks fine. I’ve attached a screen of the texture applied to my model in its current state. I’ve checked my texture coordinate buffer and every vertex seems to have two texture coordinates… Not to sure where to go from here, I might be missing some vital piece of knowledge any small tips of where I could’ve gone wrong is appreciated thanks.
SOLVED… Sorry, turns out I just forgot to set the offset into my vbo for my texture coordinates, im dumb >.<
unsigned int TextureID; glGenTextures(1, &TextureID); glBindTexture(GL_TEXTURE_2D, TextureID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, Image->w, Image->h, 0, GL_RGB, GL_UNSIGNED_BYTE, Image->pixels); glBindTexture(GL_TEXTURE_2D, 0);