# vertex associated with several texture coordinates?

Hello guys,

I (too ) intend to design an easy-to-extend (for Python programmers) minecraft clone.
But the blocks should be smaller and are used for terraforming only, objects and actors shall be rather smooth. Maybe I will open a thread to describe my project, in another sub-forum. If someone wants to join, he/she is very welcome.
Basis for my first approach was the āProcedural-Cubeā example, of course. The pycraft prototype
was then used to check, why my approach was so slow. Now, the engine is quick enough that I am certain it makes sense to go on.

For my question:
For optimization, I would like to reduce the number of vertices I send to the pipe. I thought about using Tristrips instead of Triangles.

http://imageshack.us/f/210/pandacube.png/

The problem: vertices can be used for several triangles (using Tristrips), but their texture-coordinates are linked to the vertices as defined in the GeomVertexData.

Now in PyCraft, the texture coordinates of one (vertex) coordinate may differ for adjacent triangles, for example if a dirt cube face touches a stone cube face. In the picture you see vertex 2 and 3 that belong to two faces, a red and a green one. The left triangle holds tex-coords of the texture imageās right side, the right triangle tex-coords of the imageās left side.

The texture-coordinates should have been saved in the triangle instead of the vertex, so they could be set explicitely for the adjacent triangles, without touching the vertices again.

Can anyone propose a way to assign one texture coordinate for one Tristrip triangle and set another texture coordinate for the adjacent triangle? Or a similar solution to reuse vertices?

Michael

Hey, as far as I know thereās no way to do what you want in Panda3D or in OpenGL itself. I might be wrong though. But you could try and send only those cube faces as triangle strips, which share same texture coordinates. However, that would require additional logic when generating chunks and that might affect the performance. Youād save calls on GPU, but use more CPU. So see whatās best in your case and go with that.