Jump to content
  • Advertisement

Archived

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

zedzeek

increasing d3d's rendering speed

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

i have written a simple app using d3d8. check it out on my site under demos/d3d vs opengl. but being a novice with d3d8. "if u can call 4 years experience a novice " im not to sure if im letting d3d render as fast as possible. ie the same app runs about 10% slower in d3d than it does in opengl but in theory there should be no speed difference. so ild appreciate if someone with a bit more d3d knowledge has a look. cheers zed http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Advertisement
Your problem is simply that your D3D application is not optimized. Its a simple as that. From my experiences, my Direct3D apps are at least 2x faster than my OpenGL programs.

My System:
Dual Celeron 366 OC 500
3fdx Voodoo5 5500 AGP
192 MB RAM

What you should do is start off with Microsoft''s base code, and then slowly alter it to fit your needs. I did that using a DrunkenHyena (whatever possesed him to make that alias) Direct3D tutorial. Now my code looks nothing alike. I get beautiful frame rates now in my engine.

Just do that and you should have no problems with speed

Share this post


Link to post
Share on other sites
uploaded a new version, where the window size is smaller ie so the benchmark is less influenced by the cards fillrate.
well i do have new drivers (10.80) for my vanta (tnt2) card, and experience no problems with it.

>> Your problem is simply that your D3D application is not optimized. <<

thats what i wanna know, how can i make it more optimized

>> From my experiences, my Direct3D apps are at least 2x faster than my OpenGL programs <<

do these programs do exactly the same things + can you post the code so we can all have a look.

as it stands at the moment the opengl version is gonna more than 50% quicker than the d3d version which shouldnt be, they should be running at roughly the same speed. so whats up

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
quote:
Original post by PSioNiC
What you should do is start off with Microsoft''s base code, and then slowly alter it to fit your needs. I did that using a DrunkenHyena (whatever possesed him to make that alias) Direct3D tutorial. Now my code looks nothing alike. I get beautiful frame rates now in my engine.



G''day!

Drunken Hyena is the name of my company, since I am the sole proprietor it was handy to associate myself and the company. The name is taken from a poem.

Besides PSioNiC was already taken, and I always mis-type those mixed-case names.



Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by zedzeek
as it stands at the moment the opengl version is gonna more than 50% quicker than the d3d version which shouldnt be, they should be running at roughly the same speed. so whats up


What''s killing it is your update_and_draw_FPS function.

in the openGL version its simply updating the FPS counter,
in the D3D version you''re locking a vertex buffer and doing stuff.
However, you''re doing all that in between calling end scene and flushing the render pipeline with present.
So what''s happening is that in between finishing drawing and actually displaying the render buffer, you''re doing a huge lock on the VB(which incidently will slow down the gfx chip''s pipeline anyway)and going through a big ''for'' loop.
if you move the update_and_draw_FPS func. to before begin scene it should speed the whole thing up.

hope this helps.



"Bad Day... F**K it!" -Stephen Baldwin (Usual Suspects)

Share this post


Link to post
Share on other sites
it made no difference
i tried placing it before begin scene and also after begin scene.
is it possible to get rid of the buffer locking or put both the things in the same buffer ( which doesnt sound to flexible )

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites

hmmm..... sorry, it did make a difference on mine but it wasn''t as big as I''d thought. (oo-er )

I can''t see what''s wrong to be honest.

you COULD use the same VB but I''m not sure that''d make much speed difference.

incidently, you don''t need to set the FVF flag each time if it''s the same.



"Bad Day... F**K it!" -Stephen Baldwin (Usual Suspects)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Have you tried to use D3DUSAGE_DYNAMIC when creating VB´s
and D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE when locking?

Peter

Share this post


Link to post
Share on other sites
It''s probably a video card/driver issue.

On my home PC, OpenGL is much slower than DX.
My work PC, they are about the same.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!