half3 ambientLevel : AMBIENT = {0.2, 0.2, 0.2};

#ifndef WorkingLitH
struct DirectionalLightH
{
    half3 Direction    : DIRECTION;
    half3 Diffuse      : DIFFUSE;
    half3 Specular     : SPECULAR;
};

struct PointLightH
{
    half4 Position_Att0     : POSITION_ATT0;
    half4 Diffuse_Att1      : DIFFUSE_ATT1;
    half4 Specular_Att2     : SPECULAR_ATT2;
};

struct MaterialH
{
    half4 Diffuse_Opacity  : DIFFUSE_OPACITY;
    half4 Specular_Power : SPECULAR_POWER;
    half3 Ambient  : AMBIENT;
    half3 Emissive : EMISSIVE;
    half Reflectivity : REFLECTIVITY;
};

half4 WorkingLitH(half LdN, half HdN, half power)
{
    return saturate(lit(LdN, HdN, power));
}

// Calculates diffuse lighting for a directional light, including the light color
void PS_AddDirLightDH(DirectionalLightH dl, half3 normalWorld, inout half3 d)
{
    half LdN = dot(dl.Direction.xyz, -normalWorld.xyz);
    d += dl.Diffuse.xyz * saturate(LdN);
}

#endif

DirectionalLightH    dirLights[2]    : DIRLIGHT;
PointLightH          pointLights[1]  : POINTLIGHT;
MaterialH            matSettings     : MATERIAL;

void AddLightsNoSpec(half3 normalWorld, float3 posWorld, inout half3 colorSum )
{
    PS_AddDirLightDH(dirLights[0], normalWorld, colorSum );
    PS_AddDirLightDH(dirLights[1], normalWorld, colorSum );
    //PS_AddDirLightD(dirLights[2], normalWorld, colorSum);
    
    //PS_AddPointLightD(pointLights[0], normalWorld, posWorld, colorSum );
    //PS_AddPointLightD(pointLights[1], normalWorld, posWorld, colorSum );
    //PS_AddPointLightD(pointLights[2], normalWorld, posWorld, colorSum );
}

void AddLights(half3 normalWorld, float3 posWorld, inout half3 colorSum, in half specularPower, half3 eyeVecW, inout half3 specularSum)
{
	AddLightsNoSpec( normalWorld, posWorld, colorSum );
}
