Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: 3ds Object Texture Coordinates

  1. #1
    Newbie Newbie
    Join Date
    Apr 2018
    Posts
    1

    3ds Object Texture Coordinates SOLVED

    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 >.<

    Code :
    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);
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled.jpg 
Views:	9 
Size:	7.5 KB 
ID:	2847  
    Last edited by crawlergl; 10-06-2018 at 10:44 PM. Reason: SOLVED

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •