Loaded texture is blurred?

Started by
12 comments, last by wendigo23 19 years, 3 months ago
Quote:Original post by nprz
offsetting the TexCoord by 0.05 or any amount will just move what part of the texture is displayed. and changing the Vertex will just move where it is displayed.


aha! I knew I wasnt going crazy;
This talks about what I was waffling on about.
Granted, the answer assumes you are using a texture of the right size, but in your case the jitter should be 1/<texture width> across and 1/<texture height> down, that might fix the problem.

Really, to get proper texel=>pixel alignment you'll want the cards to be proper size and then set the 2D Ortho projection so that it 0=><card width> will give you the correct size card for pixel perfect drawing, then the texture sample jitter should make any issues go away.


Quote:
Can anyone recommend any files to load BMP as a texture, so I can at least try that?


I'm betting it wont matter.
Your suffering from the fact that texels arent sampled in the centre but at the edges, so when you ask for 1,1 you infact get a sample of a few pixels in the area to build that texel.

So, my advise, make each card proper size, set up a 2D Matrix so each card will be drawn proper size and then jitter the U,V coords slightly to get around the off center sampling.

[Edited by - _the_phantom_ on January 4, 2005 11:01:57 PM]
Advertisement
Thanks for that link. I read it and noticed this

"Update: It looks like this problem might be due to invariance in texture filtering, as allowed by the OpenGL spec. The blur manifests differently on different GPUs."

This let me to test it on my dad's computer and it displays it correctly. I guess my card doesn't behave well with OpenGL.

I still don't know of a generic way to fix it, so maybe I should use SDL or something else for this card game.
Perhaps you've got anti-aliasing set by the driver on your machine? Go to your 'display properties' > 'settings' > 'advanced' (or something like that) to check :)
do unto others... and then run like hell.
One way to make it all go away is to just use a 2D api (sdl like you said? I'm not positive what its capabilities are). This game doesn't look very 3d.

This topic is closed to new replies.

Advertisement