XNA 达到简介
我收到他的错误
“当使用不是 2 的幂的纹理大小时,XNA Framework Reach 配置文件需要将 TextureAddressMode 限制为 Clamp”行,
我
GraphicsDevice.DrawUserPrimitives<VertexPositionTexture>
(PrimitiveType.TriangleStrip, verts, 0, 2);
应该做什么?
谢谢,
I get his error
"XNA Framework Reach profile requires TextureAddressMode to be Clamp when using texture sizes that are not powers of two"
for line
GraphicsDevice.DrawUserPrimitives<VertexPositionTexture>
(PrimitiveType.TriangleStrip, verts, 0, 2);
What should I do ?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用到达配置文件时,请使用两种尺寸纹理的幂或将“TextureAddressingMode”设置为“Clamp”。
TextureAddressingMode 是 GraphicsDevice SamplerState 的一部分。您需要在绘制调用之前设置此状态。以下代码显示如何将第一个纹理采样器设置为内置采样器状态之一。
When using a reach profile, use power of two sized textures or set the TextureAddressingMode to Clamp.
The TextureAddressingMode is part of the GraphicsDevice SamplerState. You need to set this state before your draw call. The following code shows how to set the first texture sampler to one of the built in sampler states.
就我而言,Model.fx 文件将 AddressMode 设置为 Wrap,这把事情弄乱了。
这是我的 Model.fx 中的正确的sampler_state:
可以在此处找到更多信息:http://www. packtpub.com/article/xna-hsl
I my case, the Model.fx file was setting the AddressMode to Wrap and that was messing it up.
Here's the correct sampler_state from my Model.fx:
More info can be found here: http://www.packtpub.com/article/xna-hsl