//Transformation Matrices
float4x4 matW;
float4x4 matV;
float4x4 matP;
float4x4 matVP;
float4x4 matLastBlock;
float4x4 matShadow;

//World Light Direction
float3 lightDir;
float ambientLight;
float4 lightCol;

float3 cameraPos;
//Camera position in world coordinates
float3 camPos;

bool useWorldScale = false;
float worldScale = 1.0f;
float towerHeight = 0.0f;

//Texture
texture texDiffuse;
texture texParam;
texture texEnvironment;
texture texEnv2D;
texture texLightmap;

//Samplers
sampler DiffuseSampler = sampler_state
{
   Texture = (texDiffuse);
   MinFilter = Linear;   MagFilter = Linear;   MipFilter = Linear;
   AddressU  = Wrap;     AddressV  = Wrap;     AddressW  = Wrap;
   MaxAnisotropy = 16;
};

sampler ParamSampler = sampler_state
{
   Texture = (texParam);
   MinFilter = Linear;   MagFilter = Linear;   MipFilter = Linear;
   AddressU  = Wrap;     AddressV  = Wrap;     AddressW  = Wrap;
   MaxAnisotropy = 16;
};

sampler EnvironmentSampler = sampler_state
{
   Texture = (texEnvironment);
   MinFilter = Linear;   MagFilter = Linear;   MipFilter = Linear;
   AddressU  = Wrap;     AddressV  = Wrap;     AddressW  = Wrap;
   MaxAnisotropy = 16;
};

sampler EnvironmentSampler2D = sampler_state
{
   Texture = (texEnv2D);
   MinFilter = Linear;   MagFilter = Linear;   MipFilter = Linear;
   AddressU  = Wrap;     AddressV  = Wrap;     AddressW  = Wrap;
   MaxAnisotropy = 16;
};


sampler LightMapSampler = sampler_state
{
   Texture = (texLightmap);
   MinFilter = Linear;   MagFilter = Linear;   MipFilter = Linear;
   AddressU  = Wrap;     AddressV  = Wrap;     AddressW  = Wrap;
   MaxAnisotropy = 16;
};



//Vertex Input
struct VS_INPUT
{
     float4 position : POSITION0;
     float3 normal   : NORMAL;
     float2 tex0     : TEXCOORD0;
};

//Vertex Output / Pixel Shader Input
struct VS_OUTPUT
{
     float4 position : POSITION0;
     float2 tex0     : TEXCOORD0;
     float4 params	 : TEXCOORD1;
     float2 tex1     : TEXCOORD2;
     float3 envUV    : TEXCOORD3;
};

struct VS_BLOCK_OUTPUT 
{
   float4 Position :        POSITION0;
   float2 Texcoord :        TEXCOORD0;
   float3 ViewDirection :   TEXCOORD1;
   float3 LightDirection :  TEXCOORD2;
   float3 Normal :          TEXCOORD3;
   float4 params	 	:   TEXCOORD4;
   float3 envUV   :         TEXCOORD5;
};

struct PS_BLOCK_INPUT 
{
   float2 Texcoord :        TEXCOORD0;
   float3 ViewDirection :   TEXCOORD1;
   float3 LightDirection:   TEXCOORD2;
   float3 Normal :          TEXCOORD3;
   float4 params	 	:   TEXCOORD4;    
   float3 envUV   :         TEXCOORD5;
};

struct VS_LIGHTING_OUTPUT 
{
   float4 Position :        POSITION0;
   float3 envUV   :         TEXCOORD4;   
   float2 Texcoord :        TEXCOORD0;
   float3 ViewDirection :   TEXCOORD1;
   float3 LightDirection :  TEXCOORD2;
   float3 Normal :          TEXCOORD3;
   float4 params	 	:   TEXCOORD5;
   
};

struct PS_LIGHTING_INPUT 
{
   float2 Texcoord :        TEXCOORD0;
   float3 ViewDirection :   TEXCOORD1;
   float3 LightDirection:   TEXCOORD2;
   float3 Normal :          TEXCOORD3;
   float3 envUV   :         TEXCOORD4; 
   float4 params	 	:   TEXCOORD5;
   
};





////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////////////

