Managed DirectX performance

Hi,

I can't get DirectX to go faster enough in 2D environment. Wasn't expecting to hit a road block so soon.

Any solutions to improve 2D performance.

VB.NET\Window\Fullscreen\

[202 byte] By [ajduck1] at [2007-12-29]
# 1
What framerate are you getting?
What computer do you have (CPU/ RAM/ GPU)?
What and how are you rendering objects?

The reason i'm asking is that you might be recreating resources inside the rendering loop and this might cause a framerate drop.
If you get a reasonably good framerate in windowed mode, then that's fine.
Have you enabled vsync? You can disable this and get a reasonably large framerate jump.

You can look at the PresentInterval Enumeration that you give to the PresentParameters that you pass to your device's constructor.

I hope this helps.
Take care.

PieterGermishuys at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 2

Check your programming, managed DX is quite good.

BadHabit at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 3

  1. 80 FPS (My little man travels 1 pixel per tick..this is not faster enough)
  2. ConroeE6600\RAM 2gig @ 1066\ATI 1300AEX512/128
  3. 24bit BMP have tried Draw and Draw fast with fullscreen exclusive
  4. No, I am not recreating surfaces in control loop
  5. What is vsync..Do you think that would increase FPS beyond 80?
  6. PresentInterval doesn't appear in my DirectDraw object browser.

Thanks for your help..80 FPS sounds good to me, rather good, but I wanted MORE!

ajduck1 at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 4

VSync makes your application to synchronize with the monitor vertical refresh (if it′s faster, waits for the monitor). It allows to get rid of small image artifacts, but it will make your application to never go over your monitor′s refresh rate.

That can be definetly the reason...

If not, something is slowing down your code. Is your scene very complex?

InakiAyucar at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 5

You shouldn't be using DirectDraw. Today's video cards are no longer optimized for 2D performance. Also, DirectDraw has been deprecated for a very long time. You might want to look at doing 2D in 3D via Direct3D, or have a look at XNA.

ProfEclipse at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 6

This is nothing wrong with Direct Draw. The problem is you are only moving the sprite (the little man) one pixel or perhaps even a partial pixel every frame. Change his X and or Y coordinates at a higher rate maybe 3 or 5 pixels.

x = x+3;

y = y+3;

Cheers,

Glen

glenrm at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...
# 7
You shouldn't be basing movement on a per-frame basis and you probably shouldn't even be doing these calculations on the rendering thread.

You should have a separate System.Threading.Thread kicked off that handles this stuff on a set interval (say 60 times per second, the most the human eye can perceive), and move the guy by varying fractional rates of pixels over time. With that he'll move as fast or slow as you want regardless of whether the user's machine can get 10fps or 3000fps on your game (remember: Their machine is not the same speed as yours, it might be much slower or it might blow it away).

If you keep your game as-is, then install this game on a new computer 2 years from now, the whole thing's going to go so fast you won't be able to play it... like BattleChess on computers today.

SoopahMan at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: General...