////////////////////////////////////////////////////////////////////////////////
// Filename: static.ps
////////////////////////////////////////////////////////////////////////////////


/////////////
// GLOBALS //
/////////////
Texture2D shaderTexture[2];
SamplerState SampleType;
float NbrLayers : register(b0);

//////////////
// TYPEDEFS //
//////////////
struct PixelInputType
{
float4 position : SV_POSITION;
float2 tex : TEXCOORD0;
float3 normal : NORMAL;
};


////////////////////////////////////////////////////////////////////////////////
// Pixel Shader
////////////////////////////////////////////////////////////////////////////////
float4 TexturePixelShader(PixelInputType input) : SV_TARGET
{
float4 textureColor;
float4 textureColor2;

// Sample the pixel color from the texture using the sampler at this texture coordinate location.
textureColor = shaderTexture[0].Sample(SampleType, input.tex);


float4 color = float4(0.05f,0.05f,0.05f,1.0f);

// Invert the light direction for calculations.
float3 lightDir = float3(1.0f,1.0f,1.0f);
float3 lightDir2 = float3(-1.0f,-1.0f,0.0f);

// Calculate the amount of light on this pixel.
float lightIntensity = saturate(dot(input.normal, lightDir));
float lightIntensity2 = saturate(dot(input.normal, lightDir2));


color += 0.6f * (float4(0.6f,0.6f,0.6f,1.0f) * lightIntensity) + 0.5f * (float4(0.6f,0.6f,0.6f,1.0f) * lightIntensity2);



// Make sure to saturate the final output light color since the combination of ambient and diffuse could have been greater than 1.
// Saturate the final light color.
color = saturate(color);




// Multiply the texture pixel and the final diffuse color to get the final pixel color result.
color = color * textureColor;


return color;
}