开发者

How do I set the texture sampler state in XNA for BasicEffect?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜