Textures are looking pretty bad - what to do?
Hello again,
I have got another problem: in my game, all textures look like being drawn with only 256 colors, but in fact I have set the color-depth to 16bit. What could I be doing wrong? I checked all my texture-loading-methods and everything is set to good quality.
So does anyone have an idea what could be going wrong?
Thanks in advance,
Marco
Its proly scene setup; can you post your screen initialization code? (particularly where you setup your pixel format descriptor)
It is the following:
Is there something wrong? To be honest, I do not know much about Windows initialisation...
static PIXELFORMATDESCRIPTOR pfd= { sizeof(PIXELFORMATDESCRIPTOR), // set size 1, // version number PFD_DRAW_TO_WINDOW | // visible in windows PFD_SUPPORT_OPENGL | // OpenGL has to be supported PFD_DOUBLEBUFFER, // Double Buffering has to be supported PFD_TYPE_RGBA, // RGBA support bits, // color-depth, where I set 16bit or 32bit 0, 0, 0, 0, 0, 0, // don't know 0, // no alpha buffer 0, // ignore Shift Bit 0, // no Accumulation Buffer 0, 0, 0, 0, // don't know 16, // 16Bit Z-Buffer (Depth Buffer) 0, // no Stencil Buffer 0, // no Auxiliary Buffer PFD_MAIN_PLANE, // where to draw later 0, // don't know 0, 0, 0 // also don't know };
Is there something wrong? To be honest, I do not know much about Windows initialisation...
Is there a reason why you use 16 bit colors instead of 32 bits?
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
I think that what you call "256 colors" are instead 16 bits color.
They are not as bad as using 256 colors, but they sure look bad.
As lc_overlord suggests, try setting bits to 32.
They are not as bad as using 256 colors, but they sure look bad.
As lc_overlord suggests, try setting bits to 32.
The value of bits is 16, but even if I set it to 32, it still looks quite bad. I have a screenshot for you, perhaps you see anything...
http://flyserver.homelinux.com/marcoh/imgs/tex_quality.jpg
As you can see, the background has a bad quality, but the picture is not stretched or anything, just the normal size.
http://flyserver.homelinux.com/marcoh/imgs/tex_quality.jpg
As you can see, the background has a bad quality, but the picture is not stretched or anything, just the normal size.
What does your glTexImage call look like? I bet it looks like:
glTexImage2d(GL_TEXTURE_2D, 0, 3, width, height, 0, format, type, pixels);
or
glTexImage2d(GL_TEXTURE_2D, 0, 4, width, height, 0, format, type, pixels);
3 and 4 are deprecated as values for internal format. You should be using the symbolic constants. 3 is equivalent to GL_RGB and 4 is equivalent to GL_RGBA. Both of these tell OpenGL that you just want the listed components, and don't care about how many bits it uses for storage. Try GL_RGB8 or GL_RGBA8, which hint to OpenGL that you want 24/32 bit colour internally, although you are not guaranteed to get what you ask for.
Enigma
glTexImage2d(GL_TEXTURE_2D, 0, 3, width, height, 0, format, type, pixels);
or
glTexImage2d(GL_TEXTURE_2D, 0, 4, width, height, 0, format, type, pixels);
3 and 4 are deprecated as values for internal format. You should be using the symbolic constants. 3 is equivalent to GL_RGB and 4 is equivalent to GL_RGBA. Both of these tell OpenGL that you just want the listed components, and don't care about how many bits it uses for storage. Try GL_RGB8 or GL_RGBA8, which hint to OpenGL that you want 24/32 bit colour internally, although you are not guaranteed to get what you ask for.
Enigma
Instead of using glTexImage2d I am using gluBuild2DMipmaps(), perhaps that plays a role (I also tried unsing GL_RGBA8, but it had no effect)? What other reason could exist for those bad textures?
I checked all my drawing code, but there is nothing to change. All textures are loaded with high quality and the correction hint is set to nicest...
...anyone has another idea?
I checked all my drawing code, but there is nothing to change. All textures are loaded with high quality and the correction hint is set to nicest...
...anyone has another idea?
No idea, You could try to look at the settings in your graphics card driver, if anything there is set to 16 bit instead of 32 bits, change it.
IF that does not work, scan trough your code looking for things that are set to 16 bits.
If nothing works then you have to send in two screenshots(one at 16 bit color mode and one at 32).
allso the relevant raw texture(or a part of it if it's big).
You would allso have to post some source code, the PFD part and the texture generation part(the one with gluBuild2DMipmaps).
Perhaps then one of us could figure out something.
IF that does not work, scan trough your code looking for things that are set to 16 bits.
If nothing works then you have to send in two screenshots(one at 16 bit color mode and one at 32).
allso the relevant raw texture(or a part of it if it's big).
You would allso have to post some source code, the PFD part and the texture generation part(the one with gluBuild2DMipmaps).
Perhaps then one of us could figure out something.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement