Sign in to follow this  
satanir

The death of D3D9

Recommended Posts

satanir    1452

Is seems really strange to me that there are still many beginners who learn D3D9. There are even questions about FVF and FF pipeline on this forum...

 

 

Besides the HLSL, D3D9 is completely different than D3D10+. How the API looks, the feature set. The programming model itself is very different. Perhaps a matter of taste, but I find D3D10 easier to work with.

 

I can't really find any good reason to learn D3D9 nowdays.

 

Share this post


Link to post
Share on other sites
Waaayoff    952

Because Windows XP still runs on 39% of PCs.

 

Edit: Also i think some find it easier not to have to deal with shaders at first. They do tend to complicate things a bit.

Edited by Waaayoff

Share this post


Link to post
Share on other sites
satanir    1452

Edit: Also i think some find it easier not to have to deal with shaders at first. They do tend to complicate things a bit.

 

In my opinion, learning fixed function is not really learning graphics. With FF, all you do is configure a state machine, plug in some matrices and that's it. You don't need to know math, you don't need to know lighting - and you will not really learn them.

 

My first experience with graphics development was implementing a software FF pipeline. I used a really crappy book with a lot of math errors, so I had to develop most of the math by myself. And implement clipper, rasterizer, depth unit, blending. After that, switching to shaders is a piece of cake.

 

Not that I expect people to write their own pipeline nowdays, but FF is a relic of the past. It's a nasty, useless shortcut.

Share this post


Link to post
Share on other sites
MJP    19753

I agree, it should be dead at this point. I also make a face whenever I see someone asking about FVF codes or other legacy fixed-function features. If anyone is looking to learn graphics then they would be much better served with a shader-based approach using a modern API.

Of course it may make sense to use D3D9 if you're writing an app that needs to target Windows XP, due to Microsoft's unfortunate decision of tying D3D features to OS features. But using it to learn is a bad idea, IMO.

Share this post


Link to post
Share on other sites
Krohm    5030

Is seems really strange to me that there are still many beginners who learn D3D9. ...

I can't really find any good reason to learn D3D9 nowdays.

Don't tell me dude. I'd drop D3D9 any day of the week if I could. Why those beginners are shooting themselves in the foot is something I cannot understand. Dealing with all the 10yo cruft is just painful IMHO!

Share this post


Link to post
Share on other sites


Also i think some find it easier not to have to deal with shaders at first. They do tend to complicate things a bit.

And instead they learn that crappy dead-end stuff about lights and materials and a myriad of device states that are only relevant for "F"VF... shudder.

Share this post


Link to post
Share on other sites
Real_Noname    276

Not so long ago I developed a driver system that abstracted 3 API's - DX9, DX11, OpenGL. From my experience by writing the same stuff in three different ways (no fixed pipline, shaders on Cg), DirectX 9 was the easiest do set up and render in terms of code written and complexity.

 

In DirectX 11 you want to render? Nope, you have to create a SwapChain. Oh, you want to render some colours? Sorry, you need to connect by view your SwapChain Buffer. You need a depth buffer? Then create it! Why is it a texture? Don't ask - and yes, you need another view.

 

DirectX 9 in comparison is so much easier to learn from the outside, because you need very little to see "something" on screen at the beginning.

Share this post


Link to post
Share on other sites
satanir    1452


DirectX 9 in comparison is so much easier to learn from the outside, because you need very little to see "something" on screen at the beginning

Maybe, I guess it's a matter of taste.

That doesn't change the fact that D3D9 is becoming obsolete, and there's little point for newbies to go anywhere near it.

Share this post


Link to post
Share on other sites
Hodgman    51220

I still use D3D9 myself for SM3 and WinXP support, but yeah, I wouldn't recommend it to a beginner.

 

All the fixed-function vertex and pixel stuff (texture combiners!) is actually more complex than a bare-bones shader IMHO.

 

I guess the beginners that come here with D3D9 questions are either using old PC's, old books, and/or old tutorials.

 

On the other hand, I did like GL1.x as a complete beginner, because the amount of code to get a triangle on screen with glBegin/etc was very small, so it was easy to take baby steps.

Share this post


Link to post
Share on other sites
Real_Noname    276

 


DirectX 9 in comparison is so much easier to learn from the outside, because you need very little to see "something" on screen at the beginning

Maybe, I guess it's a matter of taste.

That doesn't change the fact that D3D9 is becoming obsolete, and there's little point for newbies to go anywhere near it.

 

I'm just explaining the most likely reason why beginners are trying to learn DX9 - probably when they see a random DX10/DX11 tutorial with the amount of stuff you need to set up to draw a single triangle, they probably come to conclusion "I wait with this, first I learn about DX9 so i then understand DX10/DX11".

 

On the other hand, I did like GL1.x as a complete beginner, because the amount of code to get a triangle on screen with glBegin/etc was very small, so it was easy to take baby steps.

And now, because of the complete chaos context juggling to create a proper 3.3+ Core context + extension handling, most beginners in OGL learn about legacy 1.1.

Share this post


Link to post
Share on other sites
noodleBowl    713

I consider myself a beginner with Direct X and I choose to use Direct X 9

 

I mainly chose Direct X 9 because of the legacy hardware support. I mean you can support Direct X 9 using Direct X 11 but only up to certain degree if I remember correctly.

So this

 

Because Windows XP still runs on 39% of PCs.

 

Holds a very large deciding factor with me

 

 

Now in terms of using the FVF, at least for me, I feel like the tutorials and resources are at fault with this one. With D3D9 nearly all beginner coding books and tutorials I have seen talk about setting up the FVF and do not even touch on Shaders. I feel like if there is a better way to do something or it gives me more fuctionality for the long run then just explain that to me first. Don't waste my time with things that could make me work harder and lead to a dead end.

Share this post


Link to post
Share on other sites
Shane C    1368
I think it's because people are not properly informed you can target DirectX 9 cards on DirectX 11, or don't have the hardware to properly test DirectX 11-exclusive features. I have problems with this information myself. I think we need to find a way to inform the community on everything we know about this subject, assuming we haven't already, to properly inform people who aren't doing it on purpose.

Share this post


Link to post
Share on other sites
Tom KQT    1704

I think it's because people are not properly informed you can target DirectX 9 cards on DirectX 11, or don't have the hardware to properly test DirectX 11-exclusive features. I have problems with this information myself. I think we need to find a way to inform the community on everything we know about this subject, assuming we haven't already, to properly inform people who aren't doing it on purpose.

You can, but AFAIK that only allows you to use DirectX9-only graphics cards, but you still need Vista and above. So this is a solution only for people who have old hardware, not for people who have old OS (and XP is still quite common, so...).

Plus, you are limited so SM2. SM3 works only when you are using the "real" DirectX 9.0c.

 

 

All the fixed-function vertex and pixel stuff (texture combiners!) is actually more complex than a bare-bones shader IMHO.

It depends on a point of view. There are many threads here where people ask how to set the FFV states to achieve a specific look - and usually the answers are something like "I suggest you to use shaders and suddenly this will be incredibly simple and even more flexible". That's absolutely right.

But we must also admit, that for the basic stuff, the FFV is much simpler, especially if you are fine with the default values. You just set some lights, which is straightforward, and prepare and set your transform matrices. And you're done. With shaders, even if you use the Effect Frameworks, you have to code much more and learn much more immediately from the start, or you won't be able to do anything more than an empty screen.

I personaly don't agree that this doesn't teach you how graphics work. You still have to understand the basic principles, you just don't have to see so much "inside". You must know what W/V/P matrices are and how to create them, you just don't have to know how exactly to use them to transform vertices. You must know what a light of a certain type is and what are its properties and how it affects the lighting, but you don't have to care about the equations behind it.

 

Anyway, I'm fully for shaders, I haven't used FFV for years. But I'm still working with DX9.0c for compatibility and laziness issues, although I know how to use DX10/11 (and I like its structure much more, it somehow makes more "sense").

Edited by Tom KQT

Share this post


Link to post
Share on other sites
JohnnyCode    1046

Well, in case you do not need to target higher shader model than 3.0, why would you restrict your aplication to dx10+? In case of using a deffered renderer, you will more unlikely hit SM3 limit. Are there other benefits of dx10+ over dx9? (performance or so).

I have been thinking of migrating to dx10+ but the fact of creating a very small target audience, I didn't as I was not in the need of a better Shader model.

Share this post


Link to post
Share on other sites
mhagain    13430

Fixed pipeline is certainly far more complex than shaders, but using shaders does have a requirement for you to write a certain amount of supporting infrastructure before you can do anything.  They're not really strong for "just dive in and start writing code" stuff.

 

None of that should be read as advocating a preference for FFP over shaders, by the way.

 

The only thing from D3D9 that I can honestly say I miss is standalone shader constants, and that's from a convenience perspective moreso than anything else.  When trying out new ideas or experimental/test code, rapid iteration is critical, and having to declare a cbuffer struct, a D3D buffer object for it, decide the usage policy and the register it goes in, map/write/unmap, bind it, remember to release it, etc is just not as fast to work with - in this particular case.  A small-ish pool of standalone constant regs (in addition to cbuffers, not instead of them) would be handy.

Share this post


Link to post
Share on other sites
Tom KQT    1704

Well, in case you do not need to target higher shader model than 3.0, why would you restrict your aplication to dx10+? In case of using a deffered renderer, you will more unlikely hit SM3 limit. Are there other benefits of dx10+ over dx9? (performance or so).

I have been thinking of migrating to dx10+ but the fact of creating a very small target audience, I didn't as I was not in the need of a better Shader model.

That's actually a good question. If you don't need anything better than SM3.0 (and honestly, you can do great things with SM3.0), why should you limit your target audience? Easier use of DX10/11 is not an argument here.

I think that we still are not (unfortunatelly) in the times when XP is dead and you can easily ignore it. So, I personaly would make either multiplatform applications (DX9 / DX1x) or only DX9. Especially if you are a small indie developer who needs as many eager players as possible.

Share this post


Link to post
Share on other sites


I think that we still are not (unfortunatelly) in the times when XP is dead and you can easily ignore it.

But if you start today with a new project, or with game dev in general, when will you have a project "RTM"? Before April 2014? Likely not. And that's when MS abandons support for XP. I think XP use will drop rapidly then.

Share this post


Link to post
Share on other sites
satanir    1452

I think that we still are not (unfortunatelly) in the times when XP is dead and you can easily ignore it

From what I know, XP is used mostly in the corporate market, not consumers market. If you bought a PC in the last 4-5 years, you probably don't have WinXP. In that sense - XP is dead and gone.

And if XP is gone, DX9 is gone.

 

Which leads me back to the conclusion that beginners should treat DX9 as deprecated, and just stay away from it.

Edited by satanir

Share this post


Link to post
Share on other sites
ericrrichards22    2421

I really don't think it makes much sense to work on DirectX 9 anymore...  Just look at this Steam Hardware Survey data http://store.steampowered.com/hwsurvey/videocard/.

95% of Steam users (or at least the ones included in the survey, I'm not totally sure how its calculated, and can't find it quickly), have DX10/11 video cards.

Only about 7% are using XP.

 

It is a little unfortunate that there are so many books that were written during the DX9 age, and comparatively fewer written since; I've got a handful of quite excellent books I picked up a few years ago that are all written to DX9, on topics that don't have a lot of coverage in newer books.  Personally, I think the most difficult part of my transition from DX9 to DX11 was the ID3DXMesh class and all of its functionality going away; code that made heavy use of these helper methods is not the easiest to convert, since you really have to learn and understand 3D math.

Share this post


Link to post
Share on other sites
satanir    1452


What about if you are/ r were in the last year or so, targeting Xbox 360, that's DX9 - still very much in play if you ask me

True, but for people starting to learn graphics now, that doesn't make sense.

Share this post


Link to post
Share on other sites
RobMaddison    1151

What about if you are/ r were in the last year or so, targeting Xbox 360, that's DX9 - still very much in play if you ask me

True, but for people starting to learn graphics now, that doesn't make sense.

Fair point. My engine is in DX9 and I'm kind of dreading the upgrade to DX10+ as I know exactly how everything works and I don't really have time to learn/implement a new/updated API.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this