立方体边缘出现白色边缘
当我渲染一个立方体并对其进行纹理处理时,我最终会在立方体上看到白色的边缘。我检查了顶点和纹理坐标,它们对我来说看起来很好。我的纹理是 2 的幂。它是包含 4x4 纹理的纹理贴图,其中每个纹理是 16x16 像素。有人有什么建议吗?
When I render a cube and texture it I end up with white edges along the cube. I've checked the vertex and texture coordinates and they look fine to me. My texture is a power of 2. It is a texture map containing 4x4 textures in which each texture is 16x16 pixels. Does anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜你正在经历纹理渗色。您可以通过在纹理上使用 GL_CLAMP 或将 UV 坐标稍微调整为 0.0005 和 0.0095(例如)而不是 0 和 1 来解决此问题,以补偿纹理采样伪影。
I guess you are experiencing texture bleeding. You can solve it by either using GL_CLAMP on your textures or adjusting slightly your UV coordinates to 0.0005 and 0.0095 (for instance) instead of 0 and 1 to compensate for the texture sampling artifacts.