2D through 3D (the big debate)

Started by
11 comments, last by Xorcist 21 years, 5 months ago
Okay I''d been debating this for a while now with an acquaintance of mine and figured maybe some more experience individuals would like to added their two cents to it. Basically we are dicussing the ability of 3D APIs to handle 2D graphics (OpenGL and DirectX in particular). He says doing any sort of 2D (with or without included 3D aspects) will severly cut the performance of the graphics card. I say there is no difference between a 2D polygon and a 3D polygon and there should be no horrible side effects if there were a large amount of 2D graphics being shown on the screen (with or without included 3D aspects). This might be a topic better suited to the Graphics Theory forum, but maybe some people here can clear this up for us. Any resources on the net you can point us to would be greatly appreciated.
Advertisement
There are situations where certain 2D techniques will slash the performace of the graphics card. These techniques usually involve locking the back buffer and accessing it directly (rather than through API methods), since locking the back buffer can interfere with the various asynchronous background graphics processes occuring on the graphics card, it causes them to function less efficiently.

However if you are using 2D polygons, rendered through the API, then these polygons are actually faster than 3D polygons for the simple reason that they don''t need to be transformed from world space to screen space since the vertices of a 2D polygon are already defined in screen space.
---------------------------A man is in bed with his wife smoking a cigarette. She says, "Dear, you hear all those warnings about cigarettes being bad for you health, why do you still smoke?"The man replies, "Well, I''m a programmer, we don''t pay attention to warnings, only to errors."
As long as you stick to the same API, it shouldnt matter which option you take, 2D(eg Win32) or 3D(eg DirectX).

If you use several APIs or direct access (eg DirectDraw Locks) then it will go slowly.

Often the 2D driver software hasnt been tuned to support things like Polygons as they arnt common 2D primitives - thus the 3D option may go faster.



So for instance if I were to use billboards to represent 2D characters it wouldn''t create a huge drop in performance because those billboards are basically nothing more than polygons that are oriented to always face the camera. What if I were to animate those billboards? Would that change anything?
quote:Original post by Xorcist
So for instance if I were to use billboards to represent 2D characters it wouldn''t create a huge drop in performance because those billboards are basically nothing more than polygons that are oriented to always face the camera. What if I were to animate those billboards? Would that change anything?


have you ever played any n64 games? alot of their major games used
3D worlds with 2D sprites... the first one that comes to mind is Mario Kart 64. all the tracks were 3D, but all the sprites were 2D.
paper mario (obviously) was predominantly 2D.

ask yourself this:
why in in the world would it be any slower?
think about it.. instead of having THOUSANDS of triangles joined together with
complex arrangements, you have hundreds of triangles arranged on
a 2D plane. logic says that 2D would be even faster


-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
Okay so things are looking good...

How feasable do you guys think it would be to create a game engine in OpenGL along the lines of Strider 2. Which prodominantly uses 2D for all the sprites and full blown models for the levels (and some bosses). My friend frowns upon the idea and says I''m in for more trouble than it''s worth (and it''s going to run like crap), but I have a more positive outlook on it and think it has a lot of potential (though notabley a lot of work for one person). I''ve already picked up and am reading through OpenGL Game Programming and The OpenGL SuperBible.

Any advice or references that might be helpful would be appreciated. Thanks.

#1) your friend doesnt know what he''s talking about.
#2) it''s 100% feasible and would be alot easier than implementing
3D skeletal animation (textured billboards that is).

my advise- forget about your friend and show him how it''s done.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
Actually it can be slower - if there is no 3D accelerator card doing the actual work (but if the API is useing such a card, then it wouldn''t effect performance in the slightest)

Without an accelerator card, the API has to use software rendering techniques...and software rendering a texture mapped triangle (or quad) is much slower then just bliting them...heck you could even write your own 2D software routines and have it be faster then useing an API without a 3D card.
quote:Original post by MSW
Actually it can be slower - if there is no 3D accelerator card doing the actual work (but if the API is useing such a card, then it wouldn''t effect performance in the slightest)

Without an accelerator card, the API has to use software rendering techniques...and software rendering a texture mapped triangle (or quad) is much slower then just bliting them...heck you could even write your own 2D software routines and have it be faster then useing an API without a 3D card.


it can be slower than 3D? without an accelerator card, those thousands
of polys are going to take longer than the hundreds of polys no matter
if you''re doing hardware or software rendering.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
Having done 2D in D3D (7 and 8) as well as OpenGL, I''d go with OpenGL. It''s rediculously easy and OpenGL works a heck of a lot faster on older hardware. In fact, the DX8 version of my app won''t even run on a laptop that runs the OpenGL version (which is identical) at a solid 30fps at 800x600.

On newer hardware (GeForce) both DX8 and OpenGL work equally well. I can''t say really if one is better because the performance is currently capped by the performance of my GeForce 2 MX. Both run at ~350fps even when I went from a 700Mhz Duron to a 1.2Ghz Duron.

As for a performance boost from 2D to 3D, I was using DirectDraw for a project and it would barely hit 1fps in tile loaded areas. I switched to Direct3D 7 and the same area on the same PC (200Mhz 32MB ram, Voodoo 3 3500) ran at around 11fps.

In terms of DirectX 7 on older hardware, I don''t OpenGL would offer much of a boost over it if any. Maybe DX9 will fix DX8 in this area but I highly doubt it.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Tiberian Merchandise!!!! | GameShot ]

This topic is closed to new replies.

Advertisement