<commit_before>#version 120

attribute vec3 vertexPosition;
attribute vec3 vertexNormal;
attribute vec4 vertexColor;
attribute vec2 vertexUV;

varying vec3 fragmentPosition;
varying vec4 fragmentColor;
varying vec2 fragmentUV;

uniform mat4 P;
uniform vec3 lightPos;
uniform mat3 inverseMatrix;

struct lightSource
{
  vec4 position;
  vec4 diffuse;
  float constantAttenuation, linearAttenuation, quadraticAttenuation;
};
lightSource light0 = lightSource(vec4(lightPos,1.0), vec4(1.0, 1.0, 1.0, 1.0), 1.0, 0.0, 0.0 );
 
struct material
{
  vec4 diffuse;
};
material mymaterial = material(vec4(1.0, 1.0, 1.0, 1.0));

void main()
{	
	vec3 normalDirection = normalize(/*inverseMatrix * */vertexNormal);
	vec3 lightDirection;
	float attenuation;
	 
	if (light0.position.w == 0.0) // directional light
	{
		attenuation = 1.0; // no attenuation
		lightDirection = normalize(vec3(light0.position));
	}
	else // point or spot light
	{ 
		vec3 vertexToLightSource = vec3(light0.position - /*m * */ vertexPosition);
		float distance = length(vertexToLightSource);
		attenuation = 1.0 / (light0.constantAttenuation 
						   + light0.linearAttenuation * distance
						   + light0.quadraticAttenuation * distance * distance);
		lightDirection = normalize(vertexToLightSource);
	}
 
	vec3 diffuseReflection = attenuation * vec3(light0.diffuse) * vec3(mymaterial.diffuse) * max(0.0, dot(normalDirection, lightDirection));
 
	gl_Position = P * vec4(vertexPosition, 1.0);
	
	fragmentPosition = vertexPosition;
	fragmentColor = vec4(diffuseReflection, 1.0);
	fragmentUV = vec2(vertexUV.x, 1.0 - vertexUV.y);
}<commit_msg>Colors + Light<commit_after>#version 120

attribute vec3 vertexPosition;
attribute vec3 vertexNormal;
attribute vec4 vertexColor;
attribute vec2 vertexUV;

varying vec3 fragmentPosition;
varying vec4 fragmentColor;
varying vec2 fragmentUV;

uniform mat4 P;
uniform vec3 lightPos;
uniform mat3 inverseMatrix;

struct lightSource
{
  vec4 position;
  vec4 diffuse;
  float constantAttenuation, linearAttenuation, quadraticAttenuation;
};
lightSource light0 = lightSource(vec4(lightPos,1.0), vec4(1.0, 1.0, 1.0, 1.0), 1.0, 0.0, 0.0 );
 
struct material
{
  vec4 diffuse;
};
material mymaterial = material(vec4(1.0, 1.0, 1.0, 1.0));

void main()
{	
	vec3 normalDirection = normalize(/*inverseMatrix * */vertexNormal);
	vec3 lightDirection;
	float attenuation;
	 
	if (light0.position.w == 0.0) // directional light
	{
		attenuation = 1.0; // no attenuation
		lightDirection = normalize(vec3(light0.position));
	}
	else // point or spot light
	{ 
		vec3 vertexToLightSource = vec3(light0.position - /*m * */ vertexPosition);
		float distance = length(vertexToLightSource);
		attenuation = 1.0 / (light0.constantAttenuation 
						   + light0.linearAttenuation * distance
						   + light0.quadraticAttenuation * distance * distance);
		lightDirection = normalize(vertexToLightSource);
	}
 
	vec3 diffuseReflection = attenuation * vec3(light0.diffuse) * vec3(mymaterial.diffuse) * max(0.0, dot(normalDirection, lightDirection));
 
	gl_Position = P * vec4(vertexPosition, 1.0);
	
	fragmentPosition = vertexPosition;
	fragmentColor = vertexColor * vec4(diffuseReflection, 1.0);
	fragmentUV = vec2(vertexUV.x, 1.0 - vertexUV.y);
}
{'fraction_non_alphanumeric': 0.11217849395723582, 'fraction_numerical': 0.04710257204834211, 'mean_word_length': 4.633507853403142, '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': '6057483', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1051, 'n_words': 256}