Archived

This topic is now archived and is closed to further replies.

SpreeTree

Texturing Indexed Primitives

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites
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....

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites