Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texturing Indexed Primitives

Started by SpreeTree Aug 9, 2003 at 7:04 AM 6 replies 350+ views
Original Post
SpreeTree
SpreeTree
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?
JuNC
JuNC
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]
SpreeTree
SpreeTree
Cheers, thought so, so thats what Ive done. That sucks a little, but what can you do about it
GekkoCube
GekkoCube
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)?

Muhammad Haggag
Muhammad Haggag
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]

GekkoCube
GekkoCube
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....
Namethatnobodyelsetook
Namethatnobodyelsetook
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.
Toni Petrina
Toni Petrina
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".

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.