

#version 150 compatibility 

in vec4 color ;
in vec3 light_dir ;
in vec3 normal ;

vec3 bottom_color = vec3(0.2,0.2,0.5) ;
vec3 sky_color = vec3(0.2,0.2,1.0) ;

void main()
{
	float ndl = dot(light_dir,normal) ;

	vec3 sphere_color = mix(bottom_color, sky_color, ndl * 0.5 + 0.5) ;
	//vec3 sphere_color = sky_color ;

	gl_FragData[0] = vec4(sphere_color,1.0) ; //vec4(ndl)*vec4(0.0,1.0,0.0,1.0) ;
	gl_FragData[1] = vec4(normal*0.5+0.5,1.0) ;
	gl_FragData[2] = vec4(1.0) ;

	gl_FragDepth = gl_FragCoord.z ;
}