Sign in to follow this  
FZrenner

DirectX C#: shader slower than built in MDX (run from Visual Studio)

Recommended Posts

Hi there, I'm currently on some 3D stuff. Therefore, I've set up a little test-scenario with approximately 1000 static and 1000 semi-dynamic objects (simple scaled+translated+rotated boxes, constant speed, linear path). executing this program within Visual Studio (F5) It's giving me strange results regarding the framerate. Using no shaders, just the MDX on board functions, and one active static directional Light, I get around 70 FPS. Using a minimalistic shader to achieve the same lighting effect, gives me only 10 FPS ... run from within Visual Studio ... Executing the generated exe the result is more like I expected it: 80 FPS without shaders ... 120 using the shader version ... is this a known problem? is there a way to solve it?

Share this post


Link to post
Share on other sites
Quote:
Original post by FZrenner
Hi there,

I'm currently on some 3D stuff. Therefore, I've set up a little test-scenario with approximately 1000 static and 1000 semi-dynamic objects (simple scaled+translated+rotated boxes, constant speed, linear path).

executing this program within Visual Studio (F5) It's giving me strange results regarding the framerate.

Using no shaders, just the MDX on board functions, and one active static directional Light, I get around 70 FPS.
Using a minimalistic shader to achieve the same lighting effect, gives me only 10 FPS ... run from within Visual Studio ...


Executing the generated exe the result is more like I expected it:
80 FPS without shaders ...
120 using the shader version ...

is this a known problem?

is there a way to solve it?

1) Don't even think about getting any relevant performance figure when running a debug version of your program
2) even when you run a release version from the debugger, the debugger is still hooked in and can lead you to false conclusion.

Best regards,

Share this post


Link to post
Share on other sites
thanks for the fast reply.

what I don't understand is, why there is such a big difference using shaders in a debug-environment or starting the executable ... where without shaders there is'nt thst a big difference ...

Share this post


Link to post
Share on other sites

It's an unsolved mystery, see here for details.

It seems to have to do with the use of shaders (maybe safeguards surrounding the heavy use of pointers in shader handling) and there seems to have been some issue with VS2005 that may have caused this, but with the demise of MDX, I wouldn't hope for any official resolution. The best advice is that of Emmanuel's and of ZMan in that MSDN thread: just be comforted that your app will always run faster than during development, saving you a good deal of optimization worries [wink]

Share this post


Link to post
Share on other sites
thank you!

well, then I'm going to live with that.
and yes, to be happy that the program will run a lot smoother in the end helps ;)

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