<commit_before>precision highp float;

uniform sampler2D chars;
uniform vec2 charsShape;
uniform float charsStep, pixelRatio, charOffset;

varying vec4 borderColor;
varying vec4 charColor;
varying vec2 charId;
varying vec2 pointCoord;
varying float pointSize;
varying float borderWidth;

void main() {
	vec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;
	pointUV.x = 1. - pointUV.x;
	pointUV.y += charOffset;
	vec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;
	float dist = texture2D(chars, texCoord).r;

	//max-distance alpha
	if (dist < 1e-2)
		discard;

	float dif = 4. * pixelRatio * borderWidth / pointSize;
	float borderLevel = .749 - dif * .7;
	float charLevel = .749 + dif * .3;
	float gamma = .005 * charsStep / pointSize;

	float borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);
	float charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);

	vec4 color = borderColor;
	color.a *= borderAmt;

	gl_FragColor = mix(color, charColor, charAmt);
}<commit_msg>Tune up sharpness<commit_after>precision highp float;

uniform sampler2D chars;
uniform vec2 charsShape;
uniform float charsStep, pixelRatio, charOffset;

varying vec4 borderColor;
varying vec4 charColor;
varying vec2 charId;
varying vec2 pointCoord;
varying float pointSize;
varying float borderWidth;

void main() {
	vec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;
	pointUV.x = 1. - pointUV.x;
	pointUV.y += charOffset;
	vec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;
	float dist = texture2D(chars, texCoord).r;

	//max-distance alpha
	if (dist < 1e-2)
		discard;

	float dif = 6. * pixelRatio * borderWidth / pointSize;
	float borderLevel = .746 - dif * .6;
	float charLevel = .746 + dif * .4;
	float gamma = .0045 * charsStep / pointSize;

	float borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);
	float charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);

	vec4 color = borderColor;
	color.a *= borderAmt;

	gl_FragColor = mix(color, charColor, charAmt);
}
{'fraction_non_alphanumeric': 0.10881078478574868, 'fraction_numerical': 0.025517573423206548, 'mean_word_length': 4.260759493670886, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5071578', 'n_tokens_mistral': 776, 'n_tokens_neox': 711, 'n_words': 214}