Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Vertexbuffer Optimization

This topic is 6236 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 am programming an Iso3d rpg with d3d8, and am wondering what the best way is to draw the map. My problem is figuring out how best to implement a vertexbuffer to make drawing the map, (just height-mapped terrain for now) as fast as possible. To make this easier, lets assume my tiles are rectangular, rather than diamond-shaped. Would it work to render an entire row of cells from the map into a large vertex buffer at once? How do different textures work then. After setting up the buffer, can I just run another loop that applies the correct texture to each set of 4 vertices? Would the following work: (pseudocode) myvertex[20*2]; //assuming 20 horiz cells per screen //i think it should be possible to use 2 of the previous vertecies //for the next cell, so only 2 vertecies per cell are needed for(all y on screen) {  for(all x on screen) {   initialize x,y,z of myvertex from map;  }  copy myvertex[1:20] into a vertexbuf  for(all x on screen) {   apply texture   drawprimitive trianglelist,vertexbuf  } } Are there any better ways to do it? Thx.

Share this post

Link to post
Share on other sites

  • 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!