<commit_before>#version 330

uniform mat4 modelViewMatrix;
uniform vec3 cameraPosition;

in vec3 fragPosition;
in vec3 fragNormal;

out vec4 finalColor;

const vec3 lightIntensity = vec3(1.0, 1.0, 1.0);
const vec3 ambientLight = vec3(.0, .0, .0);

void main() {

    mat3 normalMatrix = transpose(inverse(mat3(modelViewMatrix)));
    vec3 normal = normalize(normalMatrix * fragNormal);

    vec3 surfaceToLight = fragPosition - cameraPosition;

    float brightness = clamp(dot(normal, surfaceToLight) / (length(surfaceToLight) * length(normal)), 0, 1);
    brightness += clamp(dot(normal, -surfaceToLight) / (length(-surfaceToLight) * length(normal)), 0, 1);

    finalColor = vec4(ambientLight + brightness * lightIntensity * vec3(.5), 1.);
}<commit_msg>Tiles render in correct order.<commit_after>#version 330

uniform mat4 modelViewMatrix;
uniform vec3 cameraPosition;

in vec3 fragPosition;
in vec3 fragNormal;

out vec4 finalColor;

const vec3 lightIntensity = vec3(1.0, 1.0, 1.0);
const vec3 ambientLight = vec3(.0, .0, .0);

void main() {

	//finalColor = vec4(1.0);

    mat3 normalMatrix = transpose(inverse(mat3(modelViewMatrix)));
    vec3 normal = normalize(normalMatrix * fragNormal);

    vec3 surfaceToLight = fragPosition - cameraPosition;

    float brightness = clamp(dot(normal, surfaceToLight) / (length(surfaceToLight) * length(normal)), 0, 1);
    brightness += clamp(dot(normal, -surfaceToLight) / (length(-surfaceToLight) * length(normal)), 0, 1);

    finalColor = vec4(ambientLight + brightness * lightIntensity * vec3(.5), 1.);
}
{'fraction_non_alphanumeric': 0.12845215157353887, 'fraction_numerical': 0.04431599229287091, 'mean_word_length': 4.813432835820896, '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': '4647277', 'n_tokens_mistral': 542, 'n_tokens_neox': 491, 'n_words': 132}