在 OpenGL ES 中仅重复纹理的一部分?
我知道可以通过将环绕模式设置为 GL_REPEAT 来重复整个纹理,但是是否可以仅重复纹理的一个子区域?例如,当纹理是图集的一部分时。
我的目标是 OpenGL ES 1.x,所以着色器已经过时了。
I know it's possible to repeat an entire texture by setting the wrap mode to GL_REPEAT, but is it somehow possible to repeat only a subregion of the texture? For example, when the texture is part of an atlas.
I'm targetting OpenGL ES 1.x, so shaders are out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这是不可能的。您唯一可以做的就是重复侧面像素(如果图像位于纹理altals的边缘)。
如果您需要平铺 - 可能这里唯一的解决方案是使用几何图形生成。否则,只需使用单独的纹理即可。
Unfortunatelly, it is not possible. The only thing you can do it to repeat side pixels (if the image is at the edge of a texture altals).
If you need tiling – probably the only solution here is generate is with geometry. Otherwise, just go with a separate texture.