Jump to content

  • Log In with Google      Sign In   
  • Create Account

Texture Address Wrapping


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Khatharr   Crossbones+   -  Reputation: 3003

Like
0Likes
Like

Posted 20 May 2012 - 05:05 PM

So I ran into a problem while testing my app on someone else's machine. My background texture is not wrapping on that specific computer. Instead it just smears everything past 1.0 in both the u and v dimensions.

In order to deal with this problem I implemented a test in my D3D init that checks the devcaps to ensure that:

*The D3DPTADDRESSCAPS_WRAP is enabled.
*MaxTextureRepeat is sufficiently large to wrap the texture (also considering D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE).

According to the SDK docs (http://msdn.microsof...9(v=vs.85).aspx) this should be all that I need to check on, but when I run the updated app on the problem machine it passes the tests and continues to fail to wrap the texture.

Screenshot attached.

The small dots are the mid-level layer, which appears to be wrapping correctly, but the smeary lines are the background layer.

What you're seeing there in the shot is the lower-right corner of the BG which is getting smeared to the right and downwards rather than wrapping. So I'm thinking that the problem is definitely with the address wrapping, but I don't know what else to test here.

Could anyone point me in the right direction here?

As always, thank you in advance for any advice.

--------------------------
Edit:

It occurs to me that the BG layer texture is significantly larger than the midl-level layers texture. The caps of this device are 2048x2048 for max texture size, which I believe is large enough, but if this turns out to be the source of the problem then if I simply use a smaller source rect when drawing the texture (via D3DXSprite) will it wrap correctly?

Attached Thumbnails

  • notwrapping.png

Edited by Khatharr, 20 May 2012 - 05:19 PM.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Sponsor:

#2 MJP   Moderators   -  Reputation: 11372

Like
0Likes
Like

Posted 20 May 2012 - 05:57 PM

Are you using non-power-of-2 textures? A lot of crappier GPU's set the D3DPTEXTURECAPS_NONPOW2CONDITIONAL cap, which means that you can only use CLAMP addressing and you can't use mipmaps.

#3 Khatharr   Crossbones+   -  Reputation: 3003

Like
0Likes
Like

Posted 21 May 2012 - 08:31 PM

Ah. Good call. I'll check that out. I'll check the square textures thing too.

Thank you.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS