1
Feature requests / Mipmapping for OpenGL texture creation?
« on: April 06, 2011, 06:41:21 pm »
+1 for this feature, it would be very useful!
Why not? Any image I load from disk has a fixed resolution obviously, but the sizes at which it will be drawn on screen may vary greatly (depending on the sprite's scales at which I blit it, and to some extent the user's screen resolution).
When loading a large image (e.g. 800x600) and blitting it to a smaller area (say 80x60) the quality will *greatly* benefit from mipmapping (as opposed to only bilinear filtering, which happens by default).
Not quite sure where/how to do this, could you elaborate please?
I'm doing this:
Now what? Doing the code above didn't seem to make any difference.
Do I have to assign this image to a sprite in any special way, or do I have to Draw the sprite differently?
Quote from: "Laurent"
Mipmapping for 2D?? It wouldn't be used at all in SFML,
Why not? Any image I load from disk has a fixed resolution obviously, but the sizes at which it will be drawn on screen may vary greatly (depending on the sprite's scales at which I blit it, and to some extent the user's screen resolution).
When loading a large image (e.g. 800x600) and blitting it to a smaller area (say 80x60) the quality will *greatly* benefit from mipmapping (as opposed to only bilinear filtering, which happens by default).
Quote
If you're using sf::Image for your texture, you can still do it:Code: [Select]image.Bind();
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
Not quite sure where/how to do this, could you elaborate please?
I'm doing this:
Code: [Select]
sf::Image myImage;
myImage.LoadFromFile("example.png");
Now what? Doing the code above didn't seem to make any difference.
Do I have to assign this image to a sprite in any special way, or do I have to Draw the sprite differently?