It also needs that you fill the correct data in your meshes BEFORE obviously. It doesn't work if you don't write the proper mapping coordinates in the meshes, in their right place, this doesn't do that kind of miracles... still...
This is the input of the vertex shader:
Code: Select all
struct{
float4 position:POSITION0;
float3 normal:NORMAL0;
float3 tangent:TEXCOORD1;
float3 binormal:TEXCOORD2;
float2 texCoord0:TEXCOORD0;
float4 color:COLOR0
};VS_INPUT
this is the output of the vertex shader:
Code: Select all
struct{
float4 position:POSITION0;
float2 texCoord0:TEXCOORD0;
float3 normal:TEXCOORD1;
float2 texCoord1:TEXCOORD2;
float2 texCoord2:TEXCOORD3;
float2 texCoord3:TEXCOORD4;
float4 color:TEXCOORD5
};PS_INPUT
Code: Select all
PS_INPUT vs_main(VS_INPUT IN){
PS_INPUT OUT;
OUT.Position... (whatever you want to put in the position...)
OUT.normal... (whatever you want to put in the normal...)
OUT.texCoord0 = IN.texCoord0;
OUT.texCoord1 = IN.tangent.xy;
OUT.texCoord2 = float2(IN.tangent.z,IN.binormal.x);
OUT.texCoord3 = IN.binormal.yz;
OUT.color = IN.color;
return OUT;
}