#version 330

#define float2 vec2
#define float3 vec3
#define float4 vec4
#define float4x4 mat4
#define float3x3 mat3

in float3 fragmentWorldPos;
in float3 fragmentNormal;
in float2 fragmentTexCoord;

out float4 fragColor;

uniform float3 g_sunDirection = float3(0.5, 1, 0.75);

uniform float3 g_diffuseColor  = float3(1,1,1);
uniform float3 g_specularColor = float3(1,1,1);

uniform sampler2D diffuseTexture;


void main(void)
{	
  // float3 v = normalize(-g_camPos);
  float3 n = fragmentNormal;
  float3 l = normalize(g_sunDirection);
  
  float3 diffuseColor = max(dot(n,l), 0.0f)*g_diffuseColor*texture(diffuseTexture, fragmentTexCoord).xyz;
 
  fragColor = float4(diffuseColor, 1.0f);
}


