Archived

This topic is now archived and is closed to further replies.

WAD3 MipMap levels

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I''m experiencing some problems with mipmap creation.Here is the deal.I''m loading images from WAD3 files and there are 4 mipmap levels for each image.But OpenGL''s function glTexImage2D is not generating me any image for any of the mipmap levels.Here is what i do: for(int i = 0;i < num_texs;i++) { glGenTextures(1,&texs.ID); glBindTexture(GL_TEXTURE_2D,texs[i].ID); glTexParameteri GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); width = texs[i].width; height = texs[i].height; for(int j = 0;j < 4;j++) { data = new uchar[width*height*3]; //get color data with the help of color palette glTexImage2D(GL_TEXTURE_2D,j,3,width,height,0,GL_RGB,GL_UNSIGNED_BYTE,data); width /= 2; height /= 2; delete [] data; } } And this is it.Just tell me if i''m doing something wrong and how can i fix these problems.You can also give me an idea about how to manually build mipmaps(with the help of glTexImage2D).10x! The PAIN is coming...this summer!!!In cinemas everywhere.

Share this post


Link to post
Share on other sites