I am making 2D sprite engine in OpenGL and I want to disable mipmaps, as I do not need them.
When I call:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, internal->internal_w, internal->internal_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
I got white rect, but when I call:
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, internal->internal_w, internal->internal_h, GL_RGBA, GL_UNSIGNED_BYTE, internal->data);
RenderWithThisTexture();
I got the properly textured rect
I figured out that this may be because of enabled mipmaps, but sadly I can't find any info how I can disable them.
I want to stick with OpenGL 1.1 (not OGL 2.0 or above code)
Increased performance – Mipmapping increases cache efficiency as full-size textures will not be needed as often, and the lower resolution mipmaps will fit more easily in the texture cache. This means texture data doesn't have to be fetched as often, reducing bandwidth usage and increasing application performance.
Mipmaps are pre-calculated groups of images that make up a main texture, intended to increase rendering speed and animation performance. They are used in the iOS version of Minecraft, as of Update 0.8.
Mipmaps. Mipmaps are lists of progressively smaller versions of an image, used to optimise performance on real-time 3D engines. Objects that are far away from the Camera use smaller Texture versions.
A high-resolution mipmap image is used for objects that are close to the user. Lower-resolution images are used as the object appears farther away. Mipmapping improves the quality of rendered textures at the expense of using more memory.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
This should be the default. Make sure you are not changing it to MIPMAP
somewhere.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With