I don't have much experience with shaders, so I will need alittle more help here.
You said I should multiply IN.color with the texture color in Pixel Shader, how? should I use mul?
float4 VolumeLinePS( TOutputVertex IN ) : COLOR
{
float4 blendFactor = IN.blend;
float4 c0 = tex2D( textureSampler, IN.tex0 );
float4 c1 = tex2D( textureSampler, IN.tex1 );
return lerp( c0, c1, blendFactor );
}
BTW, I'm not getting assertion failure or any runtime complain.
EDIT:
I tried the following vertex structure:
struct TVertex
{
D3DXVECTOR3 pos;
D3DXVECTOR3 otherPos;
DWORD color;
D3DXVECTOR4 texOffset;
D3DXVECTOR3 thickness;
static const DWORD FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE |
D3DFVF_TEX2 | // D3DFVF_TEX2 specifies we have two sets of texture coordinates.
D3DFVF_TEXCOORDSIZE4(0) | // This specifies that the first (0th) tex coord set has size 4 floats.
D3DFVF_TEXCOORDSIZE3(1); // Specifies that second tex coord set has size 2 floats.
};
Now, I can see the lines, but I don't see the diffuse color applied, maybe I have to change the Pixel Shader code?