Texturing Indexed Primitives
Hi
Im rendering a simple cube using DrawIndexedPrimitive(...) and have encountered a little problem. Obviously I only define 8 verts for the primitive, but what happens if I want the 36 indices to have seperate texture coordinates. This is needed, i think, if I want each face to have the same texture. I was hoping there was something like SetTextureStream(...) or seomthing, but there doesnt seem to be.
Any ideas?
No, if two vertices have different texture coordinates you need to duplicate the vertices for each texture coord.
[edited by - JuNC on August 9, 2003 8:31:47 AM]
[edited by - JuNC on August 9, 2003 8:31:47 AM]
Cheers, thought so, so thats what Ive done. That sucks a little, but what can you do about it
In cases where you must duplicate vertices (such as this due to texture coordinates)...would using DrawIndexPrimitives (index buffers) help over using DrawPrimitives (vertex buffers)?
Keep in mind that a cube is a very extreme case. Generally, index buffers will save you bandwidth (being smaller in size and preventing duplication)
Peace,
Muhammad Haggag
[edited by - Coder on August 9, 2003 11:58:40 AM]
Peace,
Muhammad Haggag
[edited by - Coder on August 9, 2003 11:58:40 AM]
but what is the benefit?
i can only see memory usage being the benefit, whihc would probably improve the overall performance since you''re sending less vertices.
but other than that....
i can only see memory usage being the benefit, whihc would probably improve the overall performance since you''re sending less vertices.
but other than that....
Saving memory isn''t enough?
Ok, how about by saving RAM you save GPU and AGP bandwidth, which is usually the first resource you''ll run out of.
Also, if two vertices share an index, the vertex may be transformed only once because it is in the post T&L cache. Using indices is the only way the card knows that the vertices are actually the same.
Ok, how about by saving RAM you save GPU and AGP bandwidth, which is usually the first resource you''ll run out of.
Also, if two vertices share an index, the vertex may be transformed only once because it is in the post T&L cache. Using indices is the only way the card knows that the vertices are actually the same.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement