Jump to content
  • Advertisement

Archived

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

LostLogic

Is it just me, or is 3D/2D Slow in DX8?

This topic is 6414 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 created a little program (800x600 res) demo in DX8 to display 100 2d/3d "sprites." The sprites are nothing more than 2-polygon primitives with texture maps. I am rendering in 3D space but with a 2D projection. I do this to support 2d graphics in the new DX8 which has no blitting per se anymore. With 100 128x128 objects I get about 40 frames per second! OMG, that is so slow...... On the other hand, the same demo in DX7 with standard 2d blitting is getting me 500 objects at 250 frames per second. I am not using alpha channels, rotation, scaling, or any special texture calls. I have also reduced the number of state changes to a minimum. But, I still get bad FPS ratings. This has been a concern of mine since the whole 2d/3d DX8 issue arose. It looks like any decent 2d game is going to have low FPS. Has anyone else out there tried benchmarking of 2d/3d versus straight 2d? I know copyrect is an option, but almost every 2d operation I ever do requires transparency. Oh yeah, I am running on a dual celeron 466, 192 megs ram, TNT2Ultra, DX8, Win2k. Thanks, LostLogic webmaster@lostlogic.com

Share this post


Link to post
Share on other sites
Advertisement
dual celerons, thats just funny

Did you compile in release mode?
Are you using vertex buffers?
Do you need new drivers for the TNT to make good use of Dx8?

3D is going to be slower than the 2D counterpart for simple operations like blitting, but I can''t of a reason that 200 polygons would render so slowly on that system. You would have to have ~75,000 polygons for a TNT2 to render at 40Hz.

Share this post


Link to post
Share on other sites
Magmai Kai Holmlor:

1) Yes, I compiled in release mode.

2) Yes, I am using vertex buffers.

3) I am using the latest Detonator drivers from Nvidia.

Don''t forget that these are textured polygons with a 128x128 texture map.

When I use a 64x64 texture I then get 70 FPS. This is still WAY slower than DDraw.

You said that I should be able to get ~75,000 polygons. Can you upload a demo that displays ~75,000 128x128 texture mapped polygons @ 40fps in a 2d/3d view for me?

Thanks,

LostLogic


Share this post


Link to post
Share on other sites
Do all objects have different textures?
Do you use one vertex buffer or one for each object? You should use one for all objects.
Try to draw all objects with the same texture with one DrawPrimitive call.
You could perhaps tile textures together so you have one 256x256 instead of 4 128x128.
That way you can draw more objects at once.

Share this post


Link to post
Share on other sites
TwoFlower:
I am using hardware rendering.


Peter L:
1) All objects have different textures.
2) I am using one vertex buffer.
3) All textures are different;therefore, can''t I bunch them together.
4) How would I tile them together if they have different textures?

Thanks for the help,

LostLogic
webmaster@lostlogic.com

Share this post


Link to post
Share on other sites
Well, put 4 128x128 textures in one 256x256 one - this''ll cut the number of SetTexture()s and DrawPrimitive()s. Also, try avoiding overdraw. 100 128x128 bitmaps seems a bit much on 800x600. Average overdraw of more than 29!

Another question: why use DirectX 8? DirectDraw 7 is perfect for 2D!?

- JQ, PWC Software
"programming is all about wasting time" -me

Share this post


Link to post
Share on other sites
State changes are slow. Every texture change incurs a slight performance hit.

When you tried with one 64x64 texture, did you change textures at all. Try it without any state changes if you haven''t already.

Share this post


Link to post
Share on other sites
JonnyQuest:

1) I cant combine them since they dont align to a perfect 128x128 grid. Also, there is no way to tell where the objects will be onscreen.

2) I started this thread because I question the idea that 2D can be done in 3D with the same performance. Everyone is touting how fast 2d/3d is, but I dont see it. My main point is "Show me the money." or better yet, "Show me the FPS." Of course I could use DX7, but then what about the whole 2d/3d issue?

3) 100 objects is WAY low when it comes to a 2d game such as a side-scrolling shooter. I have had close to a thousand objects onscreen in my 2d engines.

TwoFlower:
Yes, I am changing the texture each time since they are different textures. I am trying to simulate what a 2d game would go through.

ToAll:
If anyone can show me a 2d/3d solution/demo that has hundreds of objects onscreen with different textures and at a good FPS, please do it. I have read the theory but now I want to see results. So far I cant make a 2d/3d solution that is as fast as DX7. This is really the point of my thread, can it be done?

Thanks all,
LostLogic

Share this post


Link to post
Share on other sites
If you want to combine the objects into one texture, there is no reason for them to be next to each other. You can just as easily have them on opposite sides of the screen.
When you combine 4 sprites into 1 texture, you use the u and v coordinates to make four separate objects. You batch them so that there are a quarter (or a fourth for Americans) as many texture changes as there were before. Goody.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

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!