Has anyone had any luck getting LinearWrap to work with XNA 4.0 on reach profile?
Example…
device.SamplerStates[0] = SamplerState.LinearWrap;
leftVert.TexCoord = new NormalizedShort(0.0f, 0.0f);
rightVert.TexCoord = new NormalizedShort(5.0f, 1.0f);
This does not wrap the texture 5 times across the u axis. In fact it renders just as if that 5.0f was a 1.0f.
Another example…
leftVert.TexCoord = new NormalizedShort(-5.0f, 0.0f);
rightVert.TexCoord = new NormalizedShort(5.0f, 1.0f);
This wraps the texture once, but not 10 times as expected.
So… does anyone know the “rules” for how to use this system?
That is…
Is there a max supported deviation between adjacent coords?
Do all coords need to be within (-1,1)?
Does the first number have to be negative?
(And why isn’t this documented anywhere Microsoft)
I think your issue is the NormalizedShort object. “Normalized” usually means a value from -1 to 1. In case of XNA, it seems to be the same.
Try using Vector2 (floats) as your texture coords instead.