Texture Address Wrapping

Started by
1 comment, last by Khatharr 11 years, 11 months ago
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?
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.
Advertisement
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.
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.

This topic is closed to new replies.

Advertisement