Skip to main content
gamedev.net
🔒 Locked

index question

Started by ghost_city Nov 26, 2003 at 9:07 AM 8 replies 350+ views
Original Post
ghost_city
ghost_city
hi i have a question about indices. i have a terrain layed out like below. if you wanted to used indices to draw a group of quads, 4 colums and 4 rows to form a patch to draw you then continued the process from 5 -8 then go to the next 4 below them and so on.my quesion is would i be transforming uneeded vertices. 1 2 3 4 5 6 7 8 10 11 12 13-> fries with that
fries with that
ghost_city
ghost_city
anyone!
fries with that
ghost_city
ghost_city
a yes or no is all i need
fries with that
neneboricua19
neneboricua19
quote:
Original post by ghost_city
a yes or no is all i need

You need to rephrase the question. I can''t understand what you''re asking either. From the post, it''s not at all clear how your terrain is laid out. I *think* that you might be asking how to set up an index buffer to render terrain as a triangle strip but that is a huge stab in the dark.

Also, your first message was only posted at about 10am and less than an hour later you''re already saying "anyone!". You gotta give people some more time. Not everyone checks the message board a hundred times a day. Depending on the question, you may need to wait a few days for the answer.

neneboricua
SiliconMunky
SiliconMunky
quote:
Original post by ghost_city
hi i have a question about indices. i have a terrain layed out like below. if you wanted to used indices to draw a group of quads, 4 colums and 4 rows to form a patch to draw you then continued the process from 5 -8 then go to the next 4 below them
and so on.my quesion is would i be transforming uneeded vertices.



1 2 3 4 5 6 7 8
10 11 12 13->



fries with that


ummm it''s hard to know exactely what you are talking about, but yes, you can make a patch of 4 quads by 4 quads.
please tell us more about what you are trying to do.
Namethatnobodyelsetook
Namethatnobodyelsetook
I''m also in the "don''t know what you mean" category.

If you''re making a 4x4 tile, your vertices would be like this:

0 1 2 3 4
5 6 7 8 9
A B C D E
F G H I J
K L M N O

and your indices for a strip would be like this:
0 5 1 6 2 7 3 8 4 9 9 5 5 A 6 B 7 C 8 D 9 E E A A F B G...

for a list would be like this

0 1 5 1 6 5 1 2 6 2 7 6....

The vertex cache would help not transforming a vertex twice, especially if your really only doing a 4x4 grid.

Now...

If you meant, you''re doing 4x4, and are creating an 8x8 grid... ie: never sharing a vertex between each tile of the grid, then yes, you''re wasting memory, GPU transform time,. Instead of transforming 25 vertices, you''d be transforming 64... or about 60% waste.
ghost_city
ghost_city
quote:
Original post by Namethatnobodyelsetook
I''m also in the "don''t know what you mean" category.

If you''re making a 4x4 tile, your vertices would be like this:

0 1 2 3 4
5 6 7 8 9
A B C D E
F G H I J
K L M N O

and your indices for a strip would be like this:
0 5 1 6 2 7 3 8 4 9 9 5 5 A 6 B 7 C 8 D 9 E E A A F B G...

for a list would be like this

0 1 5 1 6 5 1 2 6 2 7 6....

The vertex cache would help not transforming a vertex twice, especially if your really only doing a 4x4 grid.


i apologize, this is the first forum i have joined.
my main question is this, i have a terrain defined as 128*128 vertices which i use to draw an indexed trianglelist of quads
i dont want to draw all the quads at the same time so, i use seperate index buffers to draw parts of the mesh depending on view and distance of the user my point is that by drawing the data like this below


//first set of data, draw patch out of this
1--32
|
32
or 32 vertices across and 32 down

would this cause d3d to transform vertices that are in between but have not been drawn


Now...

If you meant, you''re doing 4x4, and are creating an 8x8 grid... ie: never sharing a vertex between each tile of the grid, then yes, you''re wasting memory, GPU transform time,. Instead of transforming 25 vertices, you''d be transforming 64... or about 60% waste.


fries with that
Namethatnobodyelsetook
Namethatnobodyelsetook
Ok, I think I know what you''re asking now.

For simplicity, I''ll use a series of 2x2 tiles.


0 1 2 3
4 5 6 7
8 9 A B


So, what you want to know is, after culling, your indices have skipped some vertices, so would they all need to be transformed, right?

Lets say we''ve culled the right side, and are only drawing using vertices 0,1,4,5,8,9, you want to know if vertices 2,3,6,7 are transformed, right?

The answer... it depends. In software transformation, yes, everything between the first and last index (as specified to DrawIndexedPrimitive) would be transformed, even if not used. Hardware transformation usually transforms things on the fly based on the indices. They don''t have enough storage set aside to transform everything, and doing so would ruin their pipeline nature.

If you''re aiming for hardware transform capable cards, you''ll be fine. If someone has an older card, or a cheap on-board unaccelerated graphics chipset, they''ll waste transform time.

Games these days are requiring cards with hardware transform, so unless you''re developing something for casual gamers with old hardware, it''s not a concern.
ghost_city
ghost_city
quote:
Original post by Namethatnobodyelsetook
Ok, I think I know what you''re asking now.

For simplicity, I''ll use a series of 2x2 tiles.


0 1 2 3
4 5 6 7
8 9 A B


So, what you want to know is, after culling, your indices have skipped some vertices, so would they all need to be transformed, right?

Lets say we''ve culled the right side, and are only drawing using vertices 0,1,4,5,8,9, you want to know if vertices 2,3,6,7 are transformed, right?

The answer... it depends. In software transformation, yes, everything between the first and last index (as specified to DrawIndexedPrimitive) would be transformed, even if not used. Hardware transformation usually transforms things on the fly based on the indices. They don''t have enough storage set aside to transform everything, and doing so would ruin their pipeline nature.

If you''re aiming for hardware transform capable cards, you''ll be fine. If someone has an older card, or a cheap on-board unaccelerated graphics chipset, they''ll waste transform time.

Games these days are requiring cards with hardware transform, so unless you''re developing something for casual gamers with old hardware, it''s not a concern.



fries with that

Topic Locked

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

Sign in to reply to this topic.