SlimDX and frame per second rate. FPS seems to be low.

Started by
4 comments, last by Pseelo 15 years, 5 months ago
Hi. I'm using SlimDX for few days and generally I really admire the work you guys (I hope the authors will read the post) put into it. I'm developing a simple 2D project based on your library and the SampleFramework you included in the SDK. The project is not demanding - its scenes contain up to 20 text lines and some polygons - but I realised that the fps is really low as for that (about 60fps). At first I thought that I allowed to VSync and the fps is simply adjusted to my monitor refresh rate. I checked that and there is no trace of VSync in the code. Beside that I changed the monitor refreshing to 60Hz and back to 75Hz and the fps didn't move a bit. Unfortunately when I run the samples included in the SDK the fps is exactly the same as in my app. Even in the SampleTriangle demo. And no, my graphics card is not so slow - the samples from the newest DirectX SDK (C++, I know) are not only more complicated but dramatically faster (500fps and up for a textured mesh with light and shadows) Could anybody tell me what is wrong? Is it a SlimDX problem (which I don't want to believe) or just my lack of knowledge? There's not even any need to look at my code - I will be really happy and a lot wiser if anyone tell me what to do with the SampleTriangle to get 500fps :) By the way - is there any hope for a less laconic documentation in the future? [sorry, i should have mentioned that I use C#] Best regards. Chris. [Edited by - Pseelo on November 20, 2008 3:32:25 AM]
Advertisement
Is the PresentationInterval in your PresentParameters set to PresentInterval.Immediate?
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
Thank you kindly.
I think this solves my problem. I've got no chance to check it at once because I'm at work at the moment (and 64bit Windows I use here doesn't support SlimDX 64 for unknown reason) but I looked up the SlimDX docs and it seems that PresentInterval.Default waits for the vertical retrace period, so this might be the case.

I have additional question though. The cause why FPS rate worried me was that I wrote simple scene transition. I just use filled rectangle with alpha changing in time. Assuming I actually used VSync there should be no blinking while drawing this rectangle but for sure the drawing was not smooth. In other words - do PresentInterval.Default & backbuffer & VSync guarantee that [of course if the scene rendering time is shorter than vertical retrace period] there will be no blinking?

Best regards.
Chris.
PresentInterval.Default will attempt to v-sync but uses a lower resolution timer than PresentInterval.One, which uses timeBeginPeriod to improve the v-sync. This is not to say that PresentInterval.Default doesn't provide a good v-sync (as it does) so any tearing or "blinking" are probably caused by something else in your code.

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
If you're using the Sample Framework, as many of our samples do, your frame rate will be locked to 60 FPS by default. You can get around this by setting the Game.IsFixedTimeStep property to false.
Mike Popoloski | Journal | SlimDX
Thank you, Mike!
950 FPS and smooth V-sync looks a lot better to me :)

With respect.
Chris.

This topic is closed to new replies.

Advertisement