How to write the graphics pipeline?

I have been learning Direct3D for a while now (DX11), and I ran into a bit of a dead end. I have Frank Luna's book on D3D programming, but I feel like I could find a better tutorial out there. I am at the point of writing the vertex shader (the first one he goes over), and it is confusing me. Anybody have any good references?
Currently, I am using .fx files to write the shaders. Is that right?
Last edited on
I think I got the exact same book, all I can recommend is reading over it again and let it properly sink in until you fully understand what is happening.

And using .fx files is right for writing shaders. But you must also remember that shaders are written in hlsl for DirectX.
I figured that is what I'd have to do. Does VS debug .fx files? I always get errors when I try to build it, unspecified ones.
Update:

After playing around a bit in VS2013 (the new version), I found that they support .hlsl file types. After creating one, the default code is:
1
2
3
4
5
// This is if you select a vertex shader. THere are seperate defaults for different options
float4 main( float4 pos : POSITION ) : SV_POSITION
{
	return pos;
}


I guess this is progress? Where would I go from here? What exactly do I do to link the shader to the program itself? I haven't done anything and it seems like the program has already changed after just adding the VertexShader.hlsl file.
You should probably write a pixel shader to accompany your vertex shader. MSDN has great Direct3D11 and 10 tutorials. Any D3D10 resource is very relevant to a Direct3D11 developer, because of the similarity of both APIs (mostly it's just a change from ID3D10* to ID3D11*).

You should also stay away from the Effect framework. IIRC it's depreciated.
Last edited on
I did write a pixel shader - well, no. I clicked "create pixel shader" and one was created for me. But I was really hoping you wouldn't bring up MSDN. I cannot navigate through that at all. The only way it works for me is if I find a link from somehwere. Thanks for the advice on the Effect framework. Now I have two excuses to not use it. (the first being that there are .hlsl files anyway)
What about the samples and tutorials included within the SDK?
Wow, I never even knew they were there. Although, after checking for them, they seem kind of useless. Do you know any internet tutorials?
AceDawg45 wrote:
I guess this is progress? Where would I go from here? What exactly do I do to link the shader to the program itself? I haven't done anything and it seems like the program has already changed after just adding the VertexShader.hlsl file.
Wait.

Have you created a vertex buffer already? Do you know how to load the shader?
Last edited on
*Confused*
Vertex buffer? Please tell me that is the same as a shader?

That being said, no. No I don't know how to load the shader.
Well then, I think you should still try to look at the tutorials provided by the SDK. They provide source code, too.
Topic archived. No new replies allowed.