<commit_before>#version 300 es

precision mediump float;

in vec4 vertex_position;
layout(location = 0) out vec4 fragment_color;
uniform vec4 light_vector;

void main(void) {
    vec3 normal_vector = normalize(
        cross(dFdx(vertex_position).xyz, dFdy(vertex_position).xyz));
    float color = dot(light_vector.xyz, normal_vector);
    fragment_color.xyz = vec3(max(color, light_vector.a));
    fragment_color.a = 1.0;
}<commit_msg>Implemented Shadow Mapping in Face fragment shader<commit_after>#version 420

precision mediump float;

in vec4 vertex_position;
in vec4 source_position;

uniform mat4 light_matrix;

layout(location = 0) out vec4 fragment_color;
uniform vec4 light_vector;
layout(binding=1) uniform sampler2D depth_map;

void main(void) {
    vec4 light_projection = light_matrix * source_position;
    vec3 normal_vector = normalize(
        cross(dFdx(vertex_position).xyz, dFdy(vertex_position).xyz));
    float color = dot(light_vector.xyz, normal_vector);
    float shadow = texture(
        depth_map,
        0.5 * light_projection.xy / light_projection.w + 0.5).r
        + 0.5 - 0.5 * (light_projection.z / light_projection.w)
        < 1.0 - 0.01 ? 1.0 : 0.0;
    fragment_color.xyz = vec3(max(color, light_vector.a)) - shadow;
    fragment_color.a = 1.0;
}
{'fraction_non_alphanumeric': 0.1048951048951049, 'fraction_numerical': 0.03418803418803419, 'mean_word_length': 3.992248062015504, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3259310', 'n_tokens_mistral': 464, 'n_tokens_neox': 431, 'n_words': 102}