1

image showing my uv mapping problem

As shown by the picture above, one vertex needs to map to two different uv coordinates. I know that I can index verities with another buffer by binding it to GL_ELEMENT_ARRAY_BUFFER, but this binds the the uv in the same index. I can't find any documentations or article showing how to index uv's. I think that there is a way to do this, because it seems like something that people would find useful. How do I do it ?

4

1 回答 1

2

简单地说,没有办法索引顶点的各个属性。元素/索引缓冲区的使用适用于共享属性的排列,例如位置、uv。由于其中一个属性不能共享,其他属性也不能共享。该问题的一个简单解决方案是复制所需的信息以构建新的排列(具有不同的 uv 坐标)。

实际上,您需要支持的是多个元素/索引缓冲区,每个属性一个:用于普通属性的元素/索引缓冲区,用于 uv 属性的元素/索引缓冲区,用于位置属性的元素/索引缓冲区。但是在当前的 OpenGL(3 或 4)或 DirectX(11)(并且可能在硬件级别本身)中,这根本不存在

于 2014-04-04T06:29:23.310 回答