View Full Version : Texture Quality?
11-21-2009, 04:17 AM
I load a bmp in my texture. When I see bmp in paint its is good, but when I see that in opengl with 100% zoom its quality is less than paint.Which setting should I do?
My MagFilter is Linear and MinFilter Is LinearMipmapNearest.
Yann LE PETITCORPS
11-21-2009, 10:59 AM
What is the original definition of your .bmp ?
If you want to enlarge a 16x16 icon into a 1024x764 (or more) this is normal that the quality cannot be as good as this ...
11-21-2009, 03:59 PM
"its quality is less than paint" :do you mean the texture apears blurry ?
First try "trilinear" filtering :
MinFilter with LinearMipmapLinear.
If it works, maybe your 100% zoom is only 99,9% so with LinearMipmapNearest it means "use a lower res mipmap".
Extreme test :
MagFilter with Nearest and MinFilter with Nearest.
If you could post screenshots it would be much easier to help you.
11-21-2009, 11:56 PM
My bmp is 1024*1024 and its a map.
when i see that in paint its text s ok, but when see in opengl
its text isn't good.
I don't tray your above solution yet.I do an say you the result.
11-22-2009, 03:06 AM
I do your above solution.
I do all possible MAG and MIN filtter, but my image has still less quality than i view it in paint or MS Picture Manager.
My opengl view is -1 to 1 x, -1 to 1 y and 1 to -1 z.In glOrtho.
Yann LE PETITCORPS
11-22-2009, 03:19 AM
And what is your screen definition ?
(I don't think that this can be this, but in the case ...)
And when you reduce the size of the opengl window, it's the same thing ?
You only map the picture on a simple quad or you make a quad for each pixel ?
11-22-2009, 06:24 AM
Hi Yann LE PETITCORPS,
My screen is 800*600.
And yes, when I reduce the size of gl window, or create texture from half of image, result is the same.
I Only map the picture on a simple quad.
Yann LE PETITCORPS
11-22-2009, 08:40 AM
And you see a very better picture at exactely the same 800x600 definition with Paint ?
With what you load this picture into an OpenGL texture ?
Can you give me the picture at firstname.lastname@example.org please ?
11-22-2009, 10:40 AM
1024*1024 -> 800*600 this not 100% zoom.
try with a 1024*1024 window.
11-22-2009, 10:38 PM
My problem exist on 1024*1024 window.
I don't set any gl setting and in nvidia setting,I set texture quality to high.
11-23-2009, 05:18 AM
Give more details and screenshots please.
11-23-2009, 08:48 PM
Its some of my code :
//----- Load Teature Function -----
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, Width, Height, GL_BGR_EXT, GL_UNSIGNED_BYTE, Data);
glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 0.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 0.0);
glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 0.0);
glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 0.0);
//----- Display Function -----
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//----- Resize Function -----
// 4 above variable indicate 100% zoom.
The result of view in opengl window is this:
And when view in MS Picture Manager teh result is:
11-23-2009, 09:43 PM
link above have problem
please try this link for viewing image :
11-29-2009, 04:17 AM
I think there is some problem with magnification/minification. Dimensions doesn't match and you get a resized/blended texture.
Try to set ortho to (0.f; 1023.f; 0.f, 1023.f), don't use mipmaps you don't need them for now. draw a quad from 0.f to 1023.f and set tex coords from 0.f to 1.f. And set window size to 1024x1024px. If it looks good backtrack 1 step at a time to find what was the problem.
Also, if your input file is not power of 2, then it's possible file loading routines are resizing it to the nearest, I think DevIL did that.
11-29-2009, 05:10 AM
How are you creating a 1024x1024 window? If you're using CreateWindow(Ex) to set the window dimensions, then you need to look at AdjustWindowRect(Ex) -
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.