<commit_before>#version 440

in vec3 fNormal;
in mat4 cameraLoc;
out vec4 outColor;

void main() {
    vec3 lightdir = vec3(1, 0, 1);

    // material
    vec4 diffuse = vec4(0, 0.3, 0.0, 1.0);
    vec4 ambient = vec4(0.3, 0.3, 0.3, 1.0);
    vec4 specular = vec4(0.5,0.5,0.5,0.9);
    float shininess = 0.5;

    vec3 eye = vec3(0,0,-2);


    vec4 spec = vec4(0.0);

    // normalize both input vectors
    vec3 n = normalize(fNormal);
    vec3 e = normalize(eye);

    float intensity = max(dot(n,lightdir), 0.0);

    if (intensity > 0.0) {
	// compute the half vector
	vec3 h = normalize(lightdir + e);  
	// compute the specular term into spec
	float intSpec = max(dot(h,n), 0.0);
	spec = specular * pow(intSpec,shininess);
    }
    outColor = max(intensity *  diffuse + spec, ambient);
    //outColor = vec4(0,0.3,0, 1.0);
}<commit_msg>fix after experiment in http://shdr.bkcore.com/ (need to be tested)<commit_after>#version 440

in vec3 fNormal;
out vec4 outColor;

void main() {
  vec4 spec = vec4(0.0);
  vec3 lDir = vec3(1.0,1.0,.3);
  vec3 eye = vec3(0.0, 0.0, 0.0);
  
  vec4 diffuse = vec4(0.8,0.8,0.8,1);
  vec4 ambient = vec4(0.,0.,0.,1);
  vec4 specular = vec4(0.1,0.1,0.1,1);
  float shininess = 0.7;
  
  float intensity = max(dot(fNormal, lDir), 0.0);
  
  if (intensity > 0.0) {
    vec3 h = normalize(lDir + eye);
    float intSpec = max(dot(h,fNormal),0.0);
    spec = specular * pow(intSpec, shininess);
  }
  0utColor = max(intensity * diffuse + spec, ambient);
  //outColor = vec4(0,0.3,0, 1.0);
}
{'fraction_non_alphanumeric': 0.17049180327868851, 'fraction_numerical': 0.08655737704918033, 'mean_word_length': 2.892857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6163848', 'n_tokens_mistral': 694, 'n_tokens_neox': 641, 'n_words': 157}