Sign in to follow this  

Beginner with big performance problems

Recommended Posts

Hi, I have uploaded my source: I want to draw a map that I can load from a txt later which should just consist of 1 (there is something) and 0 (there is nothing). And for each 1 I want to draw a cube. For now I just tested drawing many cubes but with the way I do it I have very bad performance. Please have a look at my source. Is there anything wrong with drawing the same object 20000 times (for a map with the size 100*200)? And another problem is that when I draw one cube next to each other I still can see a bit of their 'walls' which should actually be covered. Thank you.

Share this post

Link to post
Share on other sites

How can I improve the performance of my Direct3D application?

The following are key areas to look at when optimizing performance:
Batch size

Direct3D is optimized for large batches of primitives. The more polygons that can be sent in a single call, the better. A good rule of thumb is to aim to average 1000 vertices per primitive call. Below that level you're probably not getting optimal performance, above that and you're into diminishing returns and potential conflicts with concurrency considerations (see below).
State changes


I would first look at doing some batching, and also frustrum culling is a cheap and easy technique you might look up.

Share this post

Link to post
Share on other sites

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

Sign in to follow this