Jump to content
  • Advertisement

eDuDe

Member
  • Content count

    37
  • Joined

  • Last visited

Community Reputation

122 Neutral

About eDuDe

  • Rank
    Member
  1. From what I understand of SOIL, I was loading the same texture but with two different methods (generating mipmaps for one, not for the other two). It is just laid out that way so I have an easier time staring at it trying to figure out what was wrong.
  2. eDuDe

    Lesson 10: Texturing issue

    I'm loading it all from the world file given in the sample: float x, y, z, u, v; int tris; char textline[255]; FILE *filein = fopen( "Assets/Worlds/World.txt", "rt"); ReadStr( filein, textline ); sscanf( textline, "NUMPOLLIES %d\n", &tris); sector1.numTriangles = tris; sector1.triangles = new triangle[sector1.numTriangles]; for ( int triangles = 0 ; triangles < sector1.numTriangles ; triangles++ ) { for ( int vert = 0 ; vert < 3 ; vert++ ) { ReadStr(filein, textline); sscanf(textline, "%f %f %f %f %f", &x, &y, &z, &u, &v); sector1.triangles[triangles].vertices[vert].x = x ; sector1.triangles[triangles].vertices[vert].y = y ; sector1.triangles[triangles].vertices[vert].z = z ; sector1.triangles[triangles].vertices[vert].u = u ; sector1.triangles[triangles].vertices[vert].v = v ; } } fclose(filein); It looked fine when stepping through the code, and I pretty much copy/pasted the tutorial project into mine with the modified texture loading and got the same result which is why I believe it has something to do with misusing SOIL.
  3. I'm runnning into a goofy texturing issue while trying to implemented this OpenGL tutorial (NeHe Lesson 10), and I've narrowed it down to how I'm loading textures using SOIL. Unfortunately this appeared to be working in previous lessons so I'm kinda lost on what to do. Any ideas? http://imgur.com/24gGJ Should be tiled, not stretched and facing one direction. texture[0] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y ); texture[1] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y ); texture[2] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS ); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glBindTexture(GL_TEXTURE_2D, texture[2]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
  4. I have a modified (just using classes and a different variable naming scheme) version of Lesson 10 working, but I get this weird texturing issue and the only thing I can think of is it is related to loading in textures using SOIL. I even went as far as modifying the sample code to use SOIL, and I get the same result: http://imgur.com/24gGJ Here is my texture loading code, which seemed to work for previous lessons (I've been doing them sequently), debug code stripped out: texture[0] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y ); texture[1] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y ); texture[2] = SOIL_load_OGL_texture( "Assets/2D/Mud.bmp", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_INVERT_Y | SOIL_FLAG_MIPMAPS ); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); glBindTexture(GL_TEXTURE_2D, texture[1]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glBindTexture(GL_TEXTURE_2D, texture[2]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);. Any idea what is up?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!