Does this follow the same principle as with the indeces-list. Ie, do you have an array containing the texture coordinates of all the faces’ vertices in the world from which you gather you texcoords?
Yes, for those polygons whose texture coordinates are constant, I just copy them from the list. For other polygons I copy and then transform them. And for still other polygons, I simply create the texture coordinates.
If so, do you create duplicates of the same vertex if you have to faces with a point in the same space but with different texture coordinates?
Yes. I do this because I’m using vertex arrays. You can’t use one index to point to two different texture entries in the texture array.
Let me get this straight. As you wander throught the BSP-tree, you generate an array of indices (specifying where to find the vertexes in the “global” vertex array) for each chain so that you may later render each “texture chain” by calling glDrawElements() and specifying the indeces of that chain.
Not exactly. What I create when walking the BSP is a set of texture sorted polygon chains and one chain of depth sorted transparent polygons.
Then for each chain, one at a time, I walk it, filling the indices array, the texture array, and the color array. I then call glDrawElements. And then repeat with the next chain.
[b]
The rendering is then a matter of taking each chain, changing the texture in accordance with it and calling glDrawElements() with the indices for that chain, before proceding to the next chain.
Have I understood that correctly?
[/b]
Yes, essentially. There are the other little details I just mentioned above.
You say you “build an array of texture coordinates” each frame, but then you cant use glDrawElements() can you?
Oh yes, why not? By build I simply mean fill.
[This message has been edited by DFrey (edited 06-24-2000).]