According to microsoft the BasicEffect.Texture uses the TextureFilter state and if it's not set it开发者_StackOverflow社区 uses TextureFilter.Linear.
Where can I set the TextureFilter state for BasicEffect?
Is it possible to set a clamp/wrap method for texture sampling?
This can also be specified in SpriteBatch.Begin()
.
e.g.:
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);
See a discussion on this at: http://forums.create.msdn.com/forums/t/63537.aspx
EDIT
Got rid of my last answer. I knew that I had written it a cleaner way before.
Try:
GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
SamplerState members can be found here.
精彩评论