attribute vec3 va_position, va_normal;

//uniform mat4 mat_view2world;

varying vec3 posVS, normalVS;
//varying vec3 posWS, normalWS;

void main(void)
{	
	vec3 temp_posVS    = (gl_ModelViewMatrix * vec4(va_position, 1.0)).xyz;
	normalVS = gl_NormalMatrix     * va_normal;
	
	float centerLen = length(vec3(0.0,0.0,va_position.z) - va_position);
	float shade = smoothstep(0.9,0.8, centerLen);
		
	posVS    = temp_posVS;
	//normalVS = temp_normalVS;
	
	//posWS    = (mat_view2world  * vec4(temp_posVS,    1.0)).xyz;
	//normalWS = (mat_view2world  * vec4(temp_normalVS, 0.0)).xyz;

	gl_Position = gl_ModelViewProjectionMatrix * vec4(va_position, 1.0);
	gl_FrontColor  = vec4(gl_Color.rgb*shade, 1.0);
}
