Sign in to follow this  

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

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

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

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

This topic is 3773 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.

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