Archived

This topic is now archived and is closed to further replies.

Bad Frame Rate

This topic is 5584 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, I''m new to DirectX programming, and I just started writing some simple 3D programs. I''m using the book "Zen of Direct3D Programming." In the book, it shows the example program with a frame rate of 330, but I am only getting a frame rate of 9! (That''s in release or debug mode.) I have no idea what may be wrong. The programs compile fine. My graphics card is a GeForce4 Ti 4200 so I don''t think that''s the problem. And any games I play run fine. Does anybody know what may be the problem?

Share this post


Link to post
Share on other sites
check your code. Maybe you are creating a software device.
most books give samples but dont use hardware rendering.

check your createdevice.

Its my duty, to please that booty ! - John Shaft

Share this post


Link to post
Share on other sites
i had the same problem when i used the Zen method 9 frame per second in my ATI Radeon 8500 but i fixed it by:

change d3dpp.SwapEffect to = D3DSWAPEFFECT_DISCARD not D3DSWAPEFFECT_COPY or D3DSWAPEFFECT_COPY_VSYNC i still dont know why but its work. it become 61 in my card but i think there still bugs in his code. his code is ugly and wrong and i am trying to fix his. any way if u want all changes i made from his code you can contact me by e-mail : Moh_Abed@hotmail.com

Share this post


Link to post
Share on other sites
Thanks for the suggestions. Changing the swap effect almost worked. It said the frame rate was over 2000 (for the "Line Lists" example) before the program crashed.

The CreateDevice did say software vertex processing, but changing it to hardware did not fix the problem.

I think the Zen book is a good introduction to DirectX, except for his code. I am going to try some other tutorials and see if I still get bad frame rates with their code.

Share this post


Link to post
Share on other sites
Stab in the dark (I do not own the book, have never read it, blah blah) -

1: You have DX8.1 SDK - Book uses 8.0?
2: Backbuffer format A8R8R8B8? Change A to X.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
One problem with the code in his book is that he render everything wheater you see it or not, the rpg book from Jim Adams does a better job at this but that book isn''t extreamly good either..but I guess it''s just that no book can solve everything...

Share this post


Link to post
Share on other sites
satting up hardware vertex processing usually doesn''t make too much of a difference sense the processor is usually not a bottleneck. Just make sure that it is set to D3DDEVTYPE_HAL and not D3DDEVTYPE_SOFTWARE when you create the device.

Btw, sounds like that book is junk. Check out www.andypike.com. Great place to get started or clear up problems you might have. And i think the best advice I can give is to read the documentation for EVERY API call you use... there''s just no substitute.

Share this post


Link to post
Share on other sites