Quote:Original post by MSeithe
Quote:Original post by Evil Steve
300-500 DrawPrimitiveUP() calls is A Bad Thing. You should use a dynamic vertex buffer for things like that. You'd put all the triangles into the VB and draw in one call. Draw[Indexed]Primitive[UP]() is a very expensive call to make (relatively).
I seem to recall that 500 draws per frame is an absolute maximum you should be drawing (Someone feel free to correct me here).
However, you should still get more than 6 FPS, and it doesn't explain why it's slower in Release mode...
That's definately a good point! Since I draw two polygons with one call to DrawPrimitiveUP() the amount of calls is about 200 / frame. I would like to draw them all in one buffer, however I'm not sure how I can use different textures for each polygon when I draw them all in one call without being able to call SetTexture(...) in between.
Yeah, you'd need to batch your draw calls so you set a texture, draw, set next texture, draw.
However, if your textures are small (They look like they're 16x16 or something), you can compile them all onto one larger texture (256x256 or 512x512 for instance), and change the texture coordinates when you fill the vertex buffer. That way you can draw most, if not all of your triangles in one draw call.
Do you have v-sync on? It looks like drawing your map is doing something that D3D isn't at all happy about.
Demirug: Found what I was looking for:
25k batches/s @ 100% 1GHz CPUSo 25k batches/s = ~417 batches/frame at 60FPS (Which is where I got my 500 from).