Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Progress Update

Sign in to follow this  


I've switched gears over the past two days back to the basics. I'm working on getting the actual board rendered on screen again. Why am I doing this gain? Well the original code was just a very quick demo. Now that I'm in a full blown alpha stage, I am potentially creating code that will be in the release version of the project, and that means creating a solid foundation.

Everything was going smoothly until I realized I had a problem. In the original demo I was calling drawprimitive() for every tile I was rendering on the board. I can't even imagine the performance hit I was creating with 1024 possible calls to drawprimitive() per frame. Yeck. So I decided I'd throw an entire map into a single vertexbuffer, thus reducing my overall calls to one. However bells imediately went off in my head. My largest map size will be 128x128 tiles. That's a crap load of tiles, with 2 polys per tile. Wasting 20,0000 unnecessary polygon draws makes me cry so now my next step is to create a simple octree of sorts. My plan is to split every map into 16x16 tile sectors. This will give me 512 polys per sector max (some tiles will be empty, containing no polys, or will be obscured). Then I will render a max of 9 sectors at once based on the camera's position. That would be a max of 4608 polys spread over 9 drawprimitive calls. I could cut my sectors down to a 8x8, Thus reducing my calls to 64 polys, but I will have draw more sectors, calling drawprimitive() more times. Yeesh. Ahh well, nothing to do but to try it. Back to the grind after I snoop around my fellow devs' journals.
Sign in to follow this  

1 Comment

Recommended Comments

That sounds like a very good idea to help performance. I used to break up my world into similar sized tiles using an octtree.

Now I do something similar, but I allow the tiles to be different sizes depending on triangle density more than volume.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!