Jump to content
  • Advertisement
Sign in to follow this  
protemus

Slow FPS with large polys

This topic is 5123 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

ok, this one is wierd. I have a quad, not textured, but I am projecting it orthographicly. I created a 2D window system over top of my 3D game. The frame rate was running at about 260 FPS. Then I started adding some 2d polys over the scene. All was going well until I added some polys that covered a large area of screen real estate. All the sudden my frame rate shot down to like 23 FPS. The following code is run MANY times during the render loop, as it is the base drawing function of the 2D section (we will just say for example it is run maybe 20 times in a frame which gives me about 40 polygons). Also note that the origin in this is upper left corner 0,0 x+=right, y+=down : (*mCurrentDrawingDepth)-=0.001f; DXWVertexStruct* vertexStruct = NULL; vertexStruct = new DXWVertexStruct[4]; vertexStruct[0].color = color; vertexStruct[0].x = 0; vertexStruct[0].y = 0; vertexStruct[0].z = *mCurrentDrawingDepth; vertexStruct[1].color = color; vertexStruct[1].x = 1024; vertexStruct[1].y = 0; vertexStruct[1].z = *mCurrentDrawingDepth; vertexStruct[2].color = color; vertexStruct[2].x = 0; vertexStruct[2].y = -768; vertexStruct[2].z = *mCurrentDrawingDepth; vertexStruct[3].color = color; vertexStruct[3].x = 1024; vertexStruct[3].y = -768; vertexStruct[3].z = *mCurrentDrawingDepth; mDirectXContext->Device()->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,vertexStruct,sizeof(DXWVertexStruct)); delete [] vertexStruct; doesn't seem to be much there right? well, I get frame rates of about 32 FPS with this code. When I change ONLY the width and height of the rect, my frame rate shoots up to 260 FPS. See the following code: (*mCurrentDrawingDepth)-=0.001f; DXWVertexStruct* vertexStruct = NULL; vertexStruct = new DXWVertexStruct[4]; vertexStruct[0].color = color; vertexStruct[0].x = 0; vertexStruct[0].y = 0; vertexStruct[0].z = *mCurrentDrawingDepth; vertexStruct[1].color = color; vertexStruct[1].x = 10; vertexStruct[1].y = 0; vertexStruct[1].z = *mCurrentDrawingDepth; vertexStruct[2].color = color; vertexStruct[2].x = 0; vertexStruct[2].y = -; vertexStruct[2].z = *mCurrentDrawingDepth; vertexStruct[3].color = color; vertexStruct[3].x = 10; vertexStruct[3].y = -10; vertexStruct[3].z = *mCurrentDrawingDepth; mDirectXContext->Device()->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,vertexStruct,sizeof(DXWVertexStruct)); delete [] vertexStruct; I am not adding or removing any polygons, only changing the size of them... what gives? Anyone have any idea what moronic thing I am misunderstanding here? I understand that more of the screen is getting pixels drawn, but I don't care how big they are, 40 polys shouldn't affect my frame rate that significantly... Any help would be appreciated!!

Share this post


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