<commit_before>#version 110

varying vec3 vertex_position;
varying vec3 vertex_normal;

uniform vec3 light_direction;
uniform vec3 ambient;
uniform vec3 diffuse;
uniform vec4 specular;

uniform float shininess;
uniform float alpha;

uniform sampler2D texture;
uniform float texture_alpha;

void
main (void)
{
  vec3 light_direction   = normalize(light_direction);
  vec3 vertex_position_n = normalize(vertex_position);

  // Ambient light component
  vec3 out_ambient = ambient;  

  // Diffuse light component
  float diffuse_factor = max(dot(light_direction, vertex_normal), 0.0);
  vec3 out_diffuse     = diffuse * diffuse_factor;  

  // Specular light component
  vec3 reflect_direction = reflect(vertex_position_n, vertex_normal);
  float amount_reflect   = dot(reflect_direction, light_direction);
  float specular_factor  = pow(max(amount_reflect, 0.0), shininess);
  vec3 out_specular      = (specular.xyz * specular_factor) * specular.w;

  // Texture colour
  vec4 out_texture       = texture2D(texture, vertex_normal.xy);

  gl_FragColor = vec4(out_ambient + out_diffuse + out_specular + (out_texture.rgb * texture_alpha), alpha);
}<commit_msg>Use new lighting shader<commit_after>#version 110

varying vec3 vertex_position;
varying vec3 vertex_normal;
varying vec2 vertex_uv;

uniform vec3 light_position;
uniform vec3 ambient;
uniform vec3 diffuse;
uniform vec4 specular;

uniform float shininess;
uniform float alpha;

uniform sampler2D texture;
uniform float     texture_alpha;

void
main (void)
{
  vec3 N = normalize(vertex_normal);
  vec3 V = normalize(vertex_position);
  vec3 R = reflect(V, N);
  vec3 L = normalize(light_position);

  vec4 o_ambient  = vec4(ambient, 1.0);
  vec4 o_diffuse  = vec4(diffuse, 1.0);
  vec4 o_specular = specular;

  vec4 r_ambient  = o_ambient;
  vec4 r_diffuse  = o_diffuse * max(dot(L, N), 0.0);
  vec4 r_specular = o_specular * pow(max(dot(R, L), 0.0), shininess);

  vec4 o_texture  = texture2D(texture, vertex_normal.xy);
  vec4 out_color  = r_ambient + r_diffuse + r_specular + (o_texture * texture_alpha);
  gl_FragColor    = vec4(out_color.rgb, alpha);
}
{'fraction_non_alphanumeric': 0.08893093661305582, 'fraction_numerical': 0.027436140018921477, 'mean_word_length': 4.8264462809917354, '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': '7491003', 'n_tokens_mistral': 760, 'n_tokens_neox': 718, 'n_words': 188}