Jump to content
  • Advertisement
Sign in to follow this  
Marco H

Textures are looking pretty bad - what to do?

This topic is 4980 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
It is the following:

	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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!