FOO Posted May 27, 2004 Posted May 27, 2004 hi all... i started porting my in-complete game engine from c#.net to managed c++.net (mc++)...but my mc++ version is too slow...i dont know why... in c#...when i render nothing...i get ~360+ frames per second...but in managed c++...i get 33fps... :confused: can anyone help me please...thanx... :)D3DDevice.txt Quote
Kavan Posted May 28, 2004 Posted May 28, 2004 I can't spot anything out of order. Have you tried profiling? Quote
ThePentiumGuy Posted May 30, 2004 Posted May 30, 2004 is it possible that these lines are slowing it down: while(this->Created) { if(this->Focused) //this.renderscene or something similar in your RenderScene function, you're testing again whether the form is in focus if(this->Focused && this->ready) then again, i'm not a very experienced C++ programmer, but maybe this will help, pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
FOO Posted May 31, 2004 Author Posted May 31, 2004 ***...one extra boolean test was sucking 67 frames (33fps before - 100fps now)... :eek: still not fast for rendering nothing on radeon igp 450 but can any one explaing this? :confused: Quote
ThePentiumGuy Posted June 1, 2004 Posted June 1, 2004 67 FRAMES??? WOW that's CRAZY! I thought it would gain a few but not 67 ;) try eliminating other tests, like while(this->Created) i mean i know you have to have that there, but idk try checking it .. not-so-often like for example bool Created = this->Created; while Created { //etc //every 5 seconds check whether its created again - not after every frame if(NumberOfSecondsTheProgramHasBeenRunning Mod 5 = 0) { Created = this->Created; } } i forgot what the Modulus operator was in C++ :) - if you have an FPS counter in your program just use the "NumberOfSeconds" variable... or maybe instead of while(this->Created) try while(this->Show) (i think Show is the right one, or maybe its a method rather than a variable..sorry man if i had my computer i could tell you what it is, but my comp's dead - all i know is that in my programs i use something else besidse Created), pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
ThePentiumGuy Posted June 1, 2004 Posted June 1, 2004 oh yeah dude also, u seem to be doing a lot of tests when you render, i dunno man try commenting those out and seeing their effects, i mean do u really need: this->ready try cutting some slack on some boolean tests, TestCooperativeLevel and this->Focused seem to be the ones u need, pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Kavan Posted June 1, 2004 Posted June 1, 2004 I doubt tests like this could have such an impact on performance. There must be something else that's wrong. What's the difference in speed between debug and retail build? Quote
ThePentiumGuy Posted June 1, 2004 Posted June 1, 2004 (edited) hmmm, well tests every frame might have a great overall impact. for example you're testing 3 booleans 100 times per second(cuz of 100 FPS), that's testing 3 variables every 10 milliseconds.. but you're right, i mean of course, rendering itself would take up a lot of FPS's (a HECK of a lot more than testing 3 booleans :) ) :p -hey "FOO" , if you were getting 360 FPS's earlier, and 1 boolean test added about 70 FPS... and im saying elimate 3 booleans - 3 * 70 = 210.. 100 + 210 = 310 heh, close to 360 huh? hey by the way, when are you displaying the FPS? maybe your FPS counter's messed up or something(i really dont know anything about them sry) maybe you're displaying them at a time when your PC's working hard (like for example when you close the program, your PresentParameter's garbage collector is trying to delete the PP, and you're displaying the FPS at that moment, or are you displaying it continuously (try, in your Loop: Console::WriteLine(YourFPS); pent Edited June 1, 2004 by ThePentiumGuy Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Kavan Posted June 1, 2004 Posted June 1, 2004 Come on. We're measuring speeds of computers in GHz nowadays. That's billions of boolean checks in a second. FOO: Just throw it through a profiler, that's the most reliable way to find out what's blocking your performance. Quote
ThePentiumGuy Posted June 1, 2004 Posted June 1, 2004 Come on. We're measuring speeds of computers in GHz nowadays. That's billions of boolean checks in a second. FOO: Just throw it through a profiler, that's the most reliable way to find out what's blocking your performance. heh, i guess i went a little too far on that last message huh? Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
FOO Posted June 4, 2004 Author Posted June 4, 2004 ok thanx all...i will check in the profiler...i will also recheck my codes... in my csharp version...there r lots of checks...but it never sucks...oh...in directx samples...i am sure all of u saw it...they use tons of checks...but still too fast... the problem should not be in number of checks per frame...it is some where else...i will check and tell u guys... have a nice time... Quote
FOO Posted June 4, 2004 Author Posted June 4, 2004 xP in release build...it says 40fps... i think i will stay with c#... :D Quote
Grasshopper_NET Posted July 31, 2004 Posted July 31, 2004 Hey FOO, I just went through the same thing with my frame counter. In your 'presentParameters->PresentationInterval' you put 'Default', this is alright for fullscreen device, but in windowed mode this should be 'Immediate'. Try this: presentParameters->PresentationInterval = PresentInterval::Immediate; Hope that helps! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.