So far, we've only used pixel shaders because we never needed to do any custom processing at the vertex shader level. However, the 3.0 model shader forces you to define a vertex shader. And that's where I get lost.
That's because our pixel shaders have this signature:
sampler2D Texture0;
struct PixelShaderInput{
float2 TexCoord : TEXCOORD0;
float4 Color : COLOR;
};
struct PixelShaderOutput {
float4 color : COLOR0;
};
PixelShaderOutput PixelShaderFirstPass( PixelShaderInput input ) {
//Magic happens here
//We use the tex2D function to sample Texture0
}
From what I've read about vertex shaders, the vertex shader output is the pixel shader input. So I added this:
struct VertexShaderInput{
float4 Position : POSITION;
}
PixelShaderInput MyVertexShader( VertexShaderInput input ){
//At a loss here...
}
I don't know how to map the vertex shader input to the pixel shader input. All examples I found on the web just have the vertex shader return a float4, which is what their pixel shader expects.