#define IN_HLSL
#include "shdrConsts.h"

//-----------------------------------------------------------------------------
// Structures
//-----------------------------------------------------------------------------
struct ConnectData
{
   float2 texCoord        : TEXCOORD1;
   float2 detailTexCoord  : TEXCOORD0;
};


struct Fragout
{
   float4 col  : COLOR0;
};


//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------
Fragout main( ConnectData IN,
              uniform sampler2D detailMap       : register(S0),
              uniform sampler2D diffuseMap      : register(S1)
)
{
   Fragout OUT;

   float4 diffuseColor = tex2D(diffuseMap, IN.texCoord);
   float4 detailColor = tex2D(detailMap, IN.detailTexCoord);

   float4 blend = lerp( detailColor, diffuseColor, diffuseColor.a );

   OUT.col = blend;


   return OUT;
}
