Jump to content
  • Advertisement
Sign in to follow this  
benryves

Excessive Texture Coordinates Distort Texture

This topic is 4082 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

The problem appears when the texture coordinates are rather excessive - for example, all of the coordinates are negative, or they all have a large integer offset. As an illustration, here's a level from Quake:
The large grey rectangle should be textured with a single image. By finding out the central texture coordinate (mean of all of the others), moving it so it's between (0,0) and (1,1), then adjusting the other coordinates by the same amount so they're all roughly in that range, I get this:
As you can see, the top edge of the texture is still distorted. I guess there's something I'm missing here as to which texture coordinates are valid. In the past I've had similar problems creating scrolling walls (ala DOOM) by steadily incrementing the texture coordinates - past a certain point they would distort like the above screenshot. It seems to be that the card can't cope with texture coordinates outside a particular range... Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
I've seen this sometimes as well. I suspect that some cards internally only handle texture coords as 16bit values (which is a reasonably optimisation, since 95% are probably between 0 and 1) and overflowing that can trip them up.

Share this post


Link to post
Share on other sites
The supported texture coordinate range is a card capability AFAIK. You may have to check the min/max values and relocate your texture coordinates.

PS: Your screenshots are pretty much black besides a few red sprinkles :)

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
I've seen this sometimes as well. I suspect that some cards internally only handle texture coords as 16bit values (which is a reasonably optimisation, since 95% are probably between 0 and 1) and overflowing that can trip them up.
Makes sense. [smile]

Quote:
Original post by Endurion
The supported texture coordinate range is a card capability AFAIK. You may have to check the min/max values and relocate your texture coordinates.
MaxTextureRepeat looks like it might help. I also tried finding the smallest set of coordinates, shunting this to the 0..1 range then offsetting all the others by the same amount, but this didn't work at all well.

[Edited by - benryves on July 24, 2007 9:56:56 AM]

Share this post


Link to post
Share on other sites
From looking at the second image it appears you have the wrap mode set to clamp instead of wrap.

If that's the case then only coordinates in the 0-1 range will work as you want them, regardless of hardware limitations.

Double check your render states :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Adam_42
From looking at the second image it appears you have the wrap mode set to clamp instead of wrap.
I was unaware that such a thing was possible, so thank you for the information. It does look like that's the problem, but I can't verify until tonight. [smile]

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!