Texture Filtering, only 2 filters do anything

Started by shadowprotocol, December 01, 2010, 02:33:29

Previous topic - Next topic

shadowprotocol

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:

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?

ryanm

You need to build mipmaps. I imagine that the texture loader can do this for you.