DX9 Shaders vs. DX11 Shaders question

Started by
2 comments, last by MJP 11 years, 5 months ago
I am in the middle of converting a SlimDX project from dx9 to dx11. Wow, so different! Anyway I have a question. In dx9, an effect consisted of an fx file with a vertex shader and a pixel shader. With dx11, there are a few more shader types naturally, but every example I find of dx11 code compiles the shaders individually. First you compile the vertex shader, then the hull shader, then the domain shader etc. and then you set them individually in the device context. Is that the way it is supposed to be done now? I don't actually mess with anything called an 'Effect'? Should I not put the different shaders in the same fx file? I haven't been able to gain any sense of a best practice when writing and managing dx11 shaders other than keeping everything separated, which would seem to complicate things, especially with so many pipeline stages that need shaders.

What is the difference, if any, between tutorials and 'real world' shader authoring?
Advertisement
The effects framework has been deprecated recently with the release of the latest Windows SDK. There used to be a separate Effects11 library in the previous DXSDK release which you could compile yourself if you wanted to use the effects library in DirectX 11, but obviously it isn't available anymore.

This does mean that you'll have to do shader management all by yourself, and I feel this is a much better solution than the old effects library as it 'forces' you to think more about how to handle your shaders and how to organize your state switches.
You could perfectly implement something like the effects framework by yourself though, there are a couple of threads floating around created by people who're doing exactly that.

I gets all your texture budgets!

Well, if it's just not needed, I can stop thinking about it! Thanks very much.
Just so you're clear, even when compiling shaders seperately you can still put multiple shaders in the same text file.

This topic is closed to new replies.

Advertisement