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

terrain: vertex cache

Started by SlimTimmy Aug 18, 2005 at 2:09 AM 5 replies 800+ views
Original Post
SlimTimmy
SlimTimmy
I'm using the texture splatting technique to texture my terrain (it's relatively small: 129x129 vertices). But it is often necessary to render the terrain multiple times (e.g. to apply more terrain textures or a lightmap). So I think I should invest some time to optimize the terrain mesh. That's how it currently works: I have a vertexbuffer which holds the vertices which are written to it row by row: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 The triangles are defined by an indexbuffer, which refers to the vertices. (I'm using triangle lists, also arranged row by row) The problem with this technique is, that nearly every vertex has to be transformed twice, because the vertex cache is to small to hold one complete row in memory (that would be 129 vertices) I also tried out the NvStrip library and some D3DX functions to optimize the mesh for optimal vertex cache usage, but the results were even worse. Maybe you could give me some advice.
deffer
deffer
Got to go to work, so I'll make this very short:


00 01 02 03 04
05 06 07 08 09
1
0 11 12 13 14
15 16 17 18 19
20 21 22 23 24


Two lists(or strips), each one going vertically.
That way only one row's vertices are doubled.
~def
SlimTimmy
SlimTimmy
Thank you very much! I'll try that out.
Another question related to vertex caches:
I'm using the smallest vertex size possible (just the position is stored). Does this influence the count of vertices which can be hold in the cache? (normally 16 or 24)
SlimTimmy
SlimTimmy
sorry for double posting. ;)
Basiror
Basiror
i think the api will convert to the GPUs floating point format or maybe the gpu does it when you send them

in general i would store it as "float" the vertex cache will most likely be inside a floating point unit i am pretty sure about this
http://www.8ung.at/basiror/theironcross.html
SlimTimmy
SlimTimmy
Quote:
Original post by Basiror
i think the api will convert to the GPUs floating point format or maybe the gpu does it when you send them

in general i would store it as "float" the vertex cache will most likely be inside a floating point unit i am pretty sure about this


I think you didn't get my question. [wink]
I would like to know whether the vertex cache would be able to hold more than the regular number of 24 vertices if I used smaller vertices.

Topic Locked

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

Sign in to reply to this topic.