Advertisement

Mipmaps Problem

Started by August 24, 2003 04:01 AM
2 comments, last by lightworker 21 years, 6 months ago
Hi I am using NeHe''s IPicture Code to load MipMaps into my scene Everything is just fine until I try to use mipmaps I have changed texture generation code in fallowing way glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR ); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, (GLsizei) lWidthPixels,(GLsizei) lHeightPixels, GL_RGB, GL_UNSIGNED_BYTE, pBits); And the effect is: http://www.sknou.pwsz.elblag.pl/~smarcjanski/mipmaps.jpg Can someone help? ps: I was trying to debug variables and it looks fine for me - I am using Visual C++ .net OpenMIND-ed Programmer lightworker@wp.pl
Slaweklightworker@wp.pl
Oh

I forgot - this picture is just textured cube (or it should be) - without mipmaps it loox fine...


OpenMIND-ed Programmer
lightworker@wp.pl
Slaweklightworker@wp.pl
Advertisement
I believe the IPicture code adds an alpha channel, so instead of:

gluBuild2DMipmaps(GL_TEXTURE_2D, 3, (GLsizei) lWidthPixels,(GLsizei) lHeightPixels, GL_RGB, GL_UNSIGNED_BYTE, pBits);

try:

gluBuild2DMipmaps(GL_TEXTURE_2D, 3, (GLsizei) lWidthPixels,(GLsizei) lHeightPixels, GL_RGBA, GL_UNSIGNED_BYTE, pBits);
Thanx it works fine now

Best Wishes

OpenMIND-ed Programmer
lightworker@wp.pl
Slaweklightworker@wp.pl

This topic is closed to new replies.

Advertisement