Texturing Indexed Primitives

Started by
6 comments, last by SpreeTree 20 years, 8 months ago
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?
Advertisement
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]
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]

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....
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.
Or you could simply create new texture composed of those smaller textures.
So... Muira Yoshimoto sliced off his head, walked 8 miles, and defeated a Mongolian horde... by beating them with his head?

Documentation? "We are writing games, we don't have to document anything".

This topic is closed to new replies.

Advertisement