Jump to content
  • Advertisement
Sign in to follow this  
SlimTimmy

terrain: vertex cache

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!