Managed Directx is too slow could the problem be in the settings ... (Corrected)

Started by
17 comments, last by algorhythmic 18 years, 4 months ago
Managed DirectX is virtually the same speed as unmanaged DirectX. Check things like your renderstates, your batching algorithms, culling algorithms, and all that stuff. Fire up PIX and see if you are making any redundant DirectX calls, or doing anything particularly harmful on performance, and find out what's taking up the most of your application's time.

Of course, the performance problem could also be in your game code and not in your graphic's code.

And don't forget the obvious things like using the release versions of DirectX and compiling in release, and not debug mode.
Advertisement
Just to chime in here, although .NET frees up a lot of memory problems, you also encounter some issues due to garbage collection (specically when you're dealing with boxing and unboxing). If your problems are memory issues, I'd try running the CLR Profiler. It'll make your game crawl, but you can still get some good info on memory allocation and garbage collection.

thanks guys for all that help my game became faster when i used the way that microsoft use to get the best graphics utility in the SDK Samples and i found some errors in my code which increase the memory and i also made the size of the textures smaller
You're not going to get better performance than Java using Managed DirectX, sorry. They're both compiled with the same goal in mind, and both are JITted in different, but common ways. Never have I seen a good game in Java, so I don't see why it's competitor will have any better advantage, other than some optimization during runtime. To get the best of speed, of course you should be using C++. Where in your code examples have you seen full 3d astonishing environments in C#/Java? There simply isn't any. Why? Because it cannot be done. I would recommend you to learn VC++ 2005 because you can use C++ while still taking advantage of the .NET framework. This can only help improve performance. C# is great for its purposes, but Managed DirectX isn't going anywhere as much as I'd like it to. If you want to use C# still, ignore using several methods and do not use autoboxing/unboxing. They kill performance, and even if you do these things, MS has a ton of this going on in the background. I love sharing good news.
If someone's going to reply to the above flaimbait, make sure it's not a flame.

I'm using the Miller approach for my windowed dx app but it uses 95% cpu even when minimized and with the entire game loop commented out. What to do???
Cheers
[email=algorhythmic@transcendenz.co.uk]algorhythmic[/email] | home | xltronic | whatever you do will be insignificant, but it is very important that you do it - mahatma gandhi
Thanks for posting that game loop, I tryed out DirectX with C# for a course a while ago, but I don't think the instructor knew how to set up the game loop properly to get good performance, I couldn't get my demo over 30 fps and there wasn't much going on so I'm gonna have to try implementing that.
Quote:Original post by algorhythmic
I'm using the Miller approach for my windowed dx app but it uses 95% cpu even when minimized and with the entire game loop commented out. What to do???
Cheers


Miller approach from which book ? i modified the SDK samples way and i am using it to create the best device and till now it is good and u feel ur game more relaxed with these settings

Tom Miller's Game Loop
An implementation of the above
[email=algorhythmic@transcendenz.co.uk]algorhythmic[/email] | home | xltronic | whatever you do will be insignificant, but it is very important that you do it - mahatma gandhi

This topic is closed to new replies.

Advertisement