<commit_before>uniform sampler2D u_fbTexture;
uniform vec3 u_color;

varying vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture2D(u_fbTexture, v_textureCoordinates);
    if (color.a == 1.0)
        discard;
    
    // TODO: make arbitrary ellipsoid
    agi_ellipsoid ellipsoid = agi_getWgs84EllipsoidEC();
    vec3 direction = normalize(agi_windowToEyeCoordinates(gl_FragCoord).xyz);
    agi_ray ray = agi_ray(vec3(0.0, 0.0, 0.0), direction);
    agi_raySegment intersection = agi_rayEllipsoidIntersectionInterval(ray, ellipsoid);
    
    if (!agi_isEmpty(intersection))
    {
        vec3 positionEC = agi_pointAlongRay(ray, intersection.start);
        vec3 positionMC = (agi_inverseModelView * vec4(positionEC, 1.0)).xyz;
	    
	    vec3 normalMC = normalize(agi_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));
	    vec3 normalEC = normalize(agi_normal * normalMC);
	    
	    AtmosphereColor atmosphereColor = computeGroundAtmosphereFromSpace(positionMC);
	    vec3 mieColor = atmosphereColor.mie;
        vec3 rayleighColor = atmosphereColor.rayleigh;
        
#ifdef SHOW_DAY    
		    vec3 startDayColor = u_color;
#else
		    vec3 startDayColor = vec3(1.0);
#endif
		
        vec3 rgb = getCentralBodyColor(positionMC, positionEC, normalMC, normalEC, startDayColor, rayleighColor, mieColor);
        gl_FragColor = vec4(rgb, 1.0);
    }
    else<commit_msg>Check central body lighting flag in pole shader too.<commit_after>uniform sampler2D u_fbTexture;
uniform vec3 u_color;

varying vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture2D(u_fbTexture, v_textureCoordinates);
    if (color.a == 1.0)
        discard;
    
    // TODO: make arbitrary ellipsoid
    agi_ellipsoid ellipsoid = agi_getWgs84EllipsoidEC();
    vec3 direction = normalize(agi_windowToEyeCoordinates(gl_FragCoord).xyz);
    agi_ray ray = agi_ray(vec3(0.0, 0.0, 0.0), direction);
    agi_raySegment intersection = agi_rayEllipsoidIntersectionInterval(ray, ellipsoid);
    
    if (!agi_isEmpty(intersection))
    {
        vec3 positionEC = agi_pointAlongRay(ray, intersection.start);
        vec3 positionMC = (agi_inverseModelView * vec4(positionEC, 1.0)).xyz;
	    
	    vec3 normalMC = normalize(agi_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));
	    vec3 normalEC = normalize(agi_normal * normalMC);
	    
	    AtmosphereColor atmosphereColor = computeGroundAtmosphereFromSpace(positionMC);
	    vec3 mieColor = atmosphereColor.mie;
        vec3 rayleighColor = atmosphereColor.rayleigh;
        
#ifdef SHOW_DAY    
        vec3 startDayColor = u_color;
#else
        vec3 startDayColor = vec3(1.0);
#endif
		
#ifdef AFFECTED_BY_LIGHTING
        vec3 rgb = getCentralBodyColor(positionMC, positionEC, normalMC, normalEC, startDayColor, rayleighColor, mieColor);
#else
        vec3 rgb = startDayColor;
#endif

        gl_FragColor = vec4(rgb, 1.0);
    }
    else
{'fraction_non_alphanumeric': 0.09156626506024096, 'fraction_numerical': 0.02857142857142857, 'mean_word_length': 3.6946688206785137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424057', 'n_tokens_mistral': 1045, 'n_tokens_neox': 967, 'n_words': 196}