Hello Guest

Texture Filtering, only 2 filters do anything

  • 1 Replies
  • 4587 Views
Texture Filtering, only 2 filters do anything
« on: December 01, 2010, 02:33:29 »
Hi, I'm using Slick_util to load in textures for my OpenGL learning adventures.

I created a program where I can hit 'F' to change the current texture, each loaded with a different filter.
Here are the 6 textures:

Code: [Select]
textures[0] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_NEAREST);
textures[1] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_LINEAR);
textures[2] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_NEAREST_MIPMAP_NEAREST);
textures[3] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_LINEAR_MIPMAP_NEAREST);
textures[4] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_NEAREST_MIPMAP_LINEAR);
textures[5] = TextureLoader.getTexture("BMP", new FileInputStream("src/Textures/Glass.bmp"), GL_LINEAR_MIPMAP_LINEAR);

The first 1, GL_NEAREST, is the normal texture with pretty jagged lines. The 2nd texture, GL_LINEAR, does a nice job of smoothing out the texture. The other 4 turn my cube into a solid white, textureless object.  What's wrong with these?

*

Offline ryanm

  • *
  • 44
Re: Texture Filtering, only 2 filters do anything
« Reply #1 on: December 01, 2010, 08:26:23 »
You need to build mipmaps. I imagine that the texture loader can do this for you.