Direct3D Pipeline overview

Started by
6 comments, last by Metus 18 years, 9 months ago
I have been looking for articles regarding the Direct3D Pipeline for some time now, but I can not find any that is up-to-date with D3D9. What I really want to know is the workflof of the Pipeline; how the Vertex ALU Unit works, how and when lighting, culling and texturemapping occurs. I was hoping that a greater knowledge of the D3D Pipeline will increase my knowlege and skill in developing game engines
Ethereal
Advertisement
The SDK's "Programming Guide" has quite a lot of useful diagrams and explanation - but it's all a bit disjoint without one "super diagram" containing everything.

I've been reading Wolfgang Engel's "Programming Vertex and Pixel Shaders" book lately, and it has a good chapter on it along with some "full pipeline" diagrams. I've seen a few other books with similar content in - maybe you want to try one of these?

Alternatively, I found a few images:



The above is almost identical to the one in the aforementioned book

The above is one I drew for my journal of the vertex shader pipeline, not quite so relevant but might be useful anyway..


hth
Jack

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

Ahh.. that was exactly that kind of information I was looking for, however, I bet D3D9 has a different (more advanced) pipeline.

I just totally forgot to check the SDK helpfile :)

Edit: i just found out that the image you linked to was the actual d3d9 pipeline :)
Ethereal
Also of interest might be the pipeline poster from this:
http://www.xmission.com/~legalize/book/preview/index.html

It's an extract from a book called "The Direct3D Pipeline" that Richard Thomson (fellow DirectX MVP and US demo scene aficianado) is/was writing.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I found some of those diagrams the other day. One thing I see from it (or I think I see), is that if you are using vertex shaders, you are apparently required to use pixel shaders to use textures on your objects. Is that true?

I've recently gotten texturing working in my engine, and this was the main problem. I had the SetTexture calls set up with proper state managing and everything set up (lighting disabled, backface cullig turned off, and no warnings from the debug), but I couldnt get textures to draw. All I did was hack in a pixel shader before the DIP call and it worked flawlessly. It might seem obvious, but I have been studying dx8 examples which used the same functions (SetVertexShader) for both FVF and programmable shaders.
Quote:Original post by Bonehed316
I found some of those diagrams the other day. One thing I see from it (or I think I see), is that if you are using vertex shaders, you are apparently required to use pixel shaders to use textures on your objects. Is that true?


No, you can still use the fixed function pipeline for pixels whilst using the programmable pipeline for vertices. Those pipeline posters are conceptual more than anything, with DirectX 8 & 9 you can mix and match between vertex/pixel shaders and their fixed function equivilents, although on modern graphics hardware it's often better for peformance if you use just shaders.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Odd, because I had my renderer set up for textures using the fixed function pipeline and vertices using vertex shaders. The only thing I was missing from the regular fixed function setup was calling SetFVF, which might explain why the vertices had no textures. Simply hacking in a call to SetPixelShader solved the problem. If you SetFVF and using vertex shaders/pixel shaders, which one actually gets drawn, or do both get drawn simultaneously?
I Finally managed to roughly scan through the direct3d pipeline and found out some new ways of coding my engine-core pipeline.

First of all, there is no Device / Renderer class but a Pipeline class that inherits from a PipelineComponent class ( implements the IDirect3DDevice9 ) and
a VPU class that manages all vertex-processing ( Indexbuffers, Vertexbuffers and Draw[Indexed]Primitive ) and VSALU class that manages ShaderDeclarations and Vertexprograms.

Both the VPU and the VSALU class inherits from the PipelineComponent class (to get access to the IDirect3DDevice9 that was instantiated by the Pipeline class)

The only thing I've got some some (naming) problems with is the fixed-function version of the VSALU ( VSALU represents the programmable part of the pipeline but I'm planning to name them VSALUP [Programmable] and VSALUF [Fixed] ).

I am still unsure about how the pixel processing part will work (but it will follow the same name-scheme with PPU, PSALUP and PSALUF)

I think I have replicated the "looks" of the d3d pipeline pretty good here and I really hope it will work better than any of my other tries to actually accomplish something

so: to set a new vertexprogram to my pipeline the code would be:
Pipeline* pPipeline = new Pipeline();pPipeline->get_VSALU()->set_program( kVertexProgram );
Ethereal

This topic is closed to new replies.

Advertisement