DX8 and 2D....good or bad?

Started by
5 comments, last by Spartacus 22 years, 8 months ago
Hi! I read the tutorial here on gamedev.net about how to do 2D rendering using D3D8. It sounds really interesting because I can use many of the features in D3D (rotating, scaling, filtering...etc). But, I also read about the disadvantages when using D3D for 2D. The big problem seems to be compatibility because the game will not run on 2D only cards. But is that really a problem anymore? Doesnt almost everyone have a 3D accelerated card today? Is there other problems when using D3D for 2D rendering that I should be aware of? If so please tell me about them. And what about performance? Wouldn''t I get a performance increase when using D3D because I can make use of 3D hardware acceleration? -Thanks René

Real programmers don't document, if it was hard to write it should be hard to understand

Advertisement
good, but there is even an easier way to do 2d in DX8, this article tells you how:

http://www.gamasutra.com/features/20010629/geczy_01.htm#l1

you don''t need to know anything about matrices either, nice.

There is no downside. Everyone has a 3d card whether they know it or not since they are standard in prebuilt computers, well people with less than p200s might not but anyone who has a computer less than five years old will have one. I''m not too far along in building my dx8 2d engine but I''m pretty sure the performance is going to be very good.
If you dont want to play around with vertices and buffers etc.. you can use the D3DXSprite interface in DX8 which does all the dirty work for you, including rotation, alpha, and scaling. I use this interface and get great results. The only problem is that not everyone has a compatible 3D card, though most games require one these days so when its time to release your game (if u wat to sell it) everyone should at least have the minumum 3D card features required to run D3D8

As for the performance, it blows DDraw away! I used to use DDraw for my 2D game and I had to use my own Alpha code, which excessively slowed down the game when more than 100000 pixels were alpha blended Now with D3D-2D I can have every blit alpha blended and it wont make a difference

If you need the code for 2D in 3D, you may d/l my D3DXSprite wrapper at:

  Downloads:  ZeroOne Realm

  Downloads:  ZeroOne Realm

quote:Original post by Anonymous Poster
There is no downside. Everyone has a 3d card whether they know it or not since they are standard in prebuilt computers, well people with less than p200s might not but anyone who has a computer less than five years old will have one.

Sorry, but this statistic is Way out. In 1996 (which is 5 years ago, or so my rudimentary arithmetic informs me), the average pc being sold was a P120, maybe a P166, with P200 being about the top model. Not only were PCs not coming with 3d capability, but I don''t even think the Voodoo 1 was available on general release until 1997. Even if it was, it was out of most people''s price range, I''m sure. PCs that were sold with accelerated 3d capability built in have only been commonly available for about 2 years now. And I know it''s tempting to believe that most people bought their computers in the last 2 years, but it''s not really true. After all, about half of people are still viewing web pages in 800x600. Also, notice all these computer manufacturers posting profit warnings? That''s because they''re selling less computers, simply because the market is saturated, and there''s little need for most people to buy new ones. That means that predictions such as "most people will have bought their PC in the last 2 years" are less valid now than ever before, since it''s apparent that people are happy to stick with what they''ve got, in general.

So although I expect most people have 3d acceleration, I expect you''re still excluding a reasonably-sized amount of people, especially if you require 8mb of video memory or more.

Kylotan, waving the flag for older pc-owners everywhere
hmm I guess I got my numbers off. But I think people greatly underestimate the number of 3d cards out among people who didn''t specifically ask for one. Oh wait yeah I did have to buy card for my old computer... hmm there goes that theory. Ok but then maybe in the last three years? My friend has a 300 that is about three years old and it has one. As for people viewing in 800x600 people that do that generally have some crazy reason. Some people keep it at that because if they increase it anymore the text gets too small to read. Sure the text can be increased but the settings are hard to find so most people don''t bother. Schools are especially bad and often have their settings locked so you can''t fix the problem for them.
Yes you''re right, schools (and even some organisations) lock their video resolutions, which is a major pain!

But besides, the whole thing about whether people have a 3D accelerator or not needs to be put into perspective:

If your game is going to be a rather high end game, then people playing it will have a 3D card.

If it''s to be released as budget, then seriously consider NOT using 100% 3D stuff.

If it''s to be released as freeware, and you don''t care if some person with an ageing PC can''t use it, then, again, don''t worry.

Also, there is a much bigger computer world than games players, trust me. Many offices, etc, see no need to upgrade their machines (because there is none) but gamers are constantly upgrading
The main problem isn''t the desktops - it''s laptops. I know people that have only a laptop, no desktop at all. Some older ones have only 2d cards.

Have you ever tried to read text on a 15", or even worse, a 13" CRT monitor set at 1024x768? It''s impossible without leaning forward unless you''ve got something like 20/10 vision. I''m using a 17" CRT and I set it for big fonts so my eyes don''t pop out of their sockets at 1024x768.

There are also quite a number of people who are using-you guessed it-640x480 resolution.

Take care of you''re eyes!

I remember my voodoo 3 could do 7 million tri''s per second-you''re drawing two per frame- so the math is:

(7,000,000 tris / 1 second) / (2 trangles/1frame)
= (7,000,000 tris / 1 second) * (1 frame / 2 triangles)
=3,500,000 frames/second

So you can be pretty sure the video card is not the bottleneck.

This topic is closed to new replies.

Advertisement