Writing future proof DX9 code (without T&L)

Started by
5 comments, last by Racky1275 16 years, 8 months ago
With all the fixed-function transformation and lighting gone with the introduction of DX10, would it be a good idea to write any new DX9 code without them too? I would guess that it would probably make any future porting to DX10 a lot easier. I'm assuming that the vertex and pixel shaders of DX9 are up to the task, as they can definately be used for per-pixel lighting. My worry is that performance under DX9 would be seriously degraded. The balance of vertex vs pixel shaders may make this more of a problem for DX9 hardware that with DX10. Thoughts anyone?
Advertisement
All functionality in the fixed-function pipeline can be easily done with vertex and pixel shaders. (I believe current drivers even implement the FFP by using built-in shaders).

There's no need to worry about a performance drop. The fixed-function pipeline is not specifically faster than a well-written shader.
Hmmm, interesting...

I wonder if you even get a speed boost when using pure DX10 class hardware?

When I get a chance I'll take a look through some DX10 examples and see if the shader code can be back-ported to DX9. I doubt it, there's a lot of new commands.
If you don't use the geometry shader, DX10 shaders are much like DX9 shaders, just with more of everything. Of course there are a lot of other changes, for example constant buffers or texture arrays, but you won't rely on them right from the beginning so your shaders should be portable easily.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
There shouldn't be any problem with dropping fixed-function these days. The question is more a case of whether you include/exclude SM1 support - there are still lots of crappy GPU's (low end desktops and laptops being good examples) in the market.

Going for an entirely FX-driven architecture is a good move with D3D9 as it will definitely help you going forwards to D3D10 and it is also capable of handling every hardware version - Fixed Func, SM1, SM2, SM3 and SM4. Write some good application-side code and you're pretty much independent of how you actually implement individual effects.

As others have said, don't worry about performance - if it proves to be a problem there are lots and lots of tools, resources and archived discussions on how to improve things.

The non-unified architecture prior to R600 and G80 can be a bit of a bugger to balance optimally, but you can get the same problem with older FF anyway.

Quote:DX10 shaders are much like DX9 shaders, just with more of everything.
I concur. For most practical cases using D3D9+SM3 is going to get you the vast majority of the features that D3D10+SM4 will.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by jollyjeffers
The question is more a case of whether you include/exclude SM1 support - there are still lots of crappy GPU's (low end desktops and laptops being good examples) in the market.

Note that the current DirectX SDK does not support SM 1.0 anymore, so you would have to develop with a DirectX SDK before June 2007 than.

You know what... Fixed function is now commented out in my code, pending deletion.
Think I'll give this a shot!

This topic is closed to new replies.

Advertisement