Jump to content
  • Advertisement
Sign in to follow this  
MattSmith_79985

DX9 Fixed Function Pipeline?

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

Since i've been trying to scour through DX tutorials and such, (specifically for terrain, of which there are NONE for DX11)
I found this site
http://www.chadvernon.com/blog/resources/directx9/terrain-generation-with-a-heightmap/

Seems legit but it's DX9.......and i've been told to stay away from DX9 because of the "fixed function" pipeline.....or something similar.
What exactly constitutes as Fixed Function pipeline? alot of the things from this tutorial look similar to the DX11 calls and such i've been making. So what exactly should I be looking for? Or do all DX9 programs generally have FFP?

Share this post


Link to post
Share on other sites
Advertisement

Since i've been trying to scour through DX tutorials and such, (specifically for terrain, of which there are NONE for DX11)
I found this site
http://www.chadverno...th-a-heightmap/

Seems legit but it's DX9.......and i've been told to stay away from DX9 because of the "fixed function" pipeline.....or something similar.
What exactly constitutes as Fixed Function pipeline? alot of the things from this tutorial look similar to the DX11 calls and such i've been making. So what exactly should I be looking for? Or do all DX9 programs generally have FFP?

Anything relating to setting up texture operations, blending operations, light setup, FVF(fixed vertex format) and the like is all fixed function pipeline, usually done through functions on the device and not on the effect.

On that page the only real FF call is the following one "pDevice->SetTransform( D3DTS_WORLD, GetTransform() );" which sets up the world transform for the pipeline.

Setting up vertex, index buffers and vertex declarations is needed for non FF as well so keep those.

Terrain stuff is easier to do in a shader than what that tutorial is doing, you can just generate a tessellated square as your terrain mesh and use a texture like the tutorial to store the height data. In the shader you read one channel of the height map and add this to the Y component of your input vertex, if the Y axis is your up vector, then multiply with the wvp and you have an undulating terrain.

Share this post


Link to post
Share on other sites
Ya I understood the DX11 tutorials I had done, and tried to use a algorithmn for setting up the grid but I had problems with it (u can see it in the DX forum). I was just looking at other tutorials (with older DX9 code) to see if I could find out what I was doing is wrong.

Share this post


Link to post
Share on other sites
For further elaborations...

Seems legit but it's DX9.......and i've been told to stay away from DX9 because of the "fixed function" pipeline.....or something similar.

Stay away of FFP because
  1. It is limited in design. It's fixed for something.
  2. It is obsolete.
  3. It is more difficult to use because of many non-orthogonalities in the API (not really a problem of FFP in itself but rather because of historical reasons - still sucks).
  4. It is more difficult to learn because there is not a small set of "core rules", instead, you just have to learn "by memory" all the configurations, hope and pray the one you need exists. Compare this to the easiness of explaining shaders: "just do whatever you want, simply output HPOS when go to the rasterizer.. or perhaps not". This is particularly true for D3D9 in my opinion.
Should you stay away from D3D9 at all?
If you can, yes. D3D9 is old, old old. If you can afford to not support it then use at least D3D10. D3D9 has various things you will miss from 10+, the FFP is one of them, but not the only reason. Other reasons include the need to deal with "reset/lost" devices, the large array of adapters which just plain out suck, a fleet of old hardware and driver combos that will drive you crazy because some users don't even know what a driver is, let alone update, the lack of some features you might just want to take for granted in 2011...

For example what NightCreature suggests is Vertex Texture Fetching - which is not supported on a lot of - still alive - D3D9 hardware. It was introduced in Shader Model 3 but there are some cards supporting SM3 which do not support VTF (or perhaps it has been a driver issue, I don't remember).
Dynamic fragment branching (at acceptable performance)? You must be jocking.
GPGPU stuff with vertex data not having OPOS? Feel free to try, please tell me if it works for you (it didn't for me).

What exactly constitutes as Fixed Function pipeline?
NightCreature seems to have nailed it, but here's a more "general" line of thinking. Take away everything that is not a shader or a function directly related to shaders. Add back everything needed to make shaders work (how to fetch buffers, how to write to framebuffers). Those are generally FFP facilities useful in shader-driven mode. Add blending, because it's still FFP in essence.
You'll need to drop a lot of concepts. The result is a smaller set of "core rules" from which you can just inferencing what you need.

Or do all DX9 programs generally have FFP?
Some part of FFP will always be there. Forever. Such as fetching buffers. But in general, it is possible to use no "oldschool" FFP at all, I do it and I'm pretty sure a lot of people is doing the same - it's just better.
But some part of FFP will always stay there. Hopefully blending will go programmable in the next D3D iteration, but you can be fairly sure concept such as "memory blob to take out vertices" or "memory blob to contain the result of rasterization" will keep going around for a while in some form or the other.

Share this post


Link to post
Share on other sites
Guest

For further elaborations...
D3D9 is old, old old.


It's old but not that old. DX10 only ships officially with Vista+ and DX11 only works on Win7. From statistics, the most used operation system today is WinXP with DX9. Also the latest DX9 release is 4/18/2011 which certainly doesn't sound obsolete to me. So if you want your game to be played by everyone than use DX9 until it really becomes obsolete. If you want the latest technology then use DX10+ but only the hard core dudes with latest software and hardware will be able to play it.

Share this post


Link to post
Share on other sites
Are you citing the Unity3D statistics? They have another interesting point to note: they have products shipping right now.
Please note the "[color=#1C2837][size=2]If you can afford to not support it then use at least D3D10". For a learner, I still don't see the point. The trend for XP is down.
[color=#1C2837][size=2][color=#1C2837][size=2]I want to reiterate the concept: D3D9 FFP takes more effort to learn and delivers less. D3D10 hardware is around since 2007 and I'm very intrigued by WARP.
[color=#1C2837][size=2]Your point is taken. I can understand your reasons, but I still disagree.
[color=#1C2837][size=2]Anyway, even if he wants to use D3D9 (it's his choice really), using its FFP is just a bad idea, we're talking about hardware from 2003 OR integrated graphics (which have kept me awake at night).

Share this post


Link to post
Share on other sites

For further elaborations...
[quote name='Mercfh' timestamp='1305218241' post='4809841']
Seems legit but it's DX9.......and i've been told to stay away from DX9 because of the "fixed function" pipeline.....or something similar.

Stay away of FFP because
  1. It is limited in design. It's fixed for something.
  2. It is obsolete.
  3. It is more difficult to use because of many non-orthogonalities in the API (not really a problem of FFP in itself but rather because of historical reasons - still sucks).
  4. It is more difficult to learn because there is not a small set of "core rules", instead, you just have to learn "by memory" all the configurations, hope and pray the one you need exists. Compare this to the easiness of explaining shaders: "just do whatever you want, simply output HPOS when go to the rasterizer.. or perhaps not". This is particularly true for D3D9 in my opinion.
Should you stay away from D3D9 at all?
If you can, yes. D3D9 is old, old old. If you can afford to not support it then use at least D3D10. D3D9 has various things you will miss from 10+, the FFP is one of them, but not the only reason. Other reasons include the need to deal with "reset/lost" devices, the large array of adapters which just plain out suck, a fleet of old hardware and driver combos that will drive you crazy because some users don't even know what a driver is, let alone update, the lack of some features you might just want to take for granted in 2011...

For example what NightCreature suggests is Vertex Texture Fetching - which is not supported on a lot of - still alive - D3D9 hardware. It was introduced in Shader Model 3 but there are some cards supporting SM3 which do not support VTF (or perhaps it has been a driver issue, I don't remember).
Dynamic fragment branching (at acceptable performance)? You must be jocking.
GPGPU stuff with vertex data not having OPOS? Feel free to try, please tell me if it works for you (it didn't for me).

What exactly constitutes as Fixed Function pipeline?
NightCreature seems to have nailed it, but here's a more "general" line of thinking. Take away everything that is not a shader or a function directly related to shaders. Add back everything needed to make shaders work (how to fetch buffers, how to write to framebuffers). Those are generally FFP facilities useful in shader-driven mode. Add blending, because it's still FFP in essence.
You'll need to drop a lot of concepts. The result is a smaller set of "core rules" from which you can just inferencing what you need.

Or do all DX9 programs generally have FFP?
Some part of FFP will always be there. Forever. Such as fetching buffers. But in general, it is possible to use no "oldschool" FFP at all, I do it and I'm pretty sure a lot of people is doing the same - it's just better.
But some part of FFP will always stay there. Hopefully blending will go programmable in the next D3D iteration, but you can be fairly sure concept such as "memory blob to take out vertices" or "memory blob to contain the result of rasterization" will keep going around for a while in some form or the other.
[/quote]

Actually stay away from DX10 as well if you can all functionality in DX10 and DX9 are available through the DX11 Feature sets. This has the advantage that you can just write stuff for one API and run on 4 sets of hardware(DX9, 10, 10.1 and 11), downside is this will only work on Vista and above.

Actually Vista fully supports DX11 it was released with win 7 and that might have gotten you confused.

If you want to break in to game development industry in the next two or three years DX9.0c knowledge is still necessary as the X360 essentially uses a modified version. Don't waste any time on the FFP in DX9 and only focus on the shader pipeline. The non FFP in DX10 and DX11 are essentially the same in how to setup the stuff, it just uses a different API.




Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!